A widget has a certain state:
- Active state. This is the default state, where widgets read their values from the request and display them.
- Disabled state, value is displayed but user input is ignored. The widget should be rendered in a manner that indicates that this widget could be active, but is currently not.
- Output state, value is displayed but user input is ignored. The widget should be rendered as plain text, giving no indication that it could be input.
- Invisible state. Values are not displayed and user input is ignored.
In the form definition, you can assign the state using an attribute called state with as value active, disabled, output or invisible. The state of a widget can of course also be modified at runtime (thus on the widget instance), by using the method setState on the widget.
The list of states above is ordered from the most featured ("active") to the most constrained ("invisible"). A widgets' actual state is the strictest between the widgets' own state and its parent state.