disable fields in bakery app

Hi guys,

how can we pass a variable to html to disable a few fields for editing operation?

We have chapter about that in our documentation here https://vaadin.com/docs/v10/flow/components/tutorial-enabled-state.html.

If you are using stock components, they have setEnabled(…) method.

If you have custom template, and element there, you can use getElement().setAttribute("disabled",true) to disable element.

Hi Tatu,

thanks for this. i want to do a scenario where we check for the access right of the user first and disable all or some fields when user enter from the userview to userform.
i was trying to use AfterNavigationEvent in the userform but does not seem to be able to do it.
Any help?