-
Notifications
You must be signed in to change notification settings - Fork 17
SubmitOnChange
Some input components implement a mechanism in which changing the selected state or value of the component will result in the underlying form being immediately posted to the application server. This is referred to as submitOnChange
.
This feature will be removed in WComponents 2.
Using submitOnChange
can cause a significant accessibility failure.
It is a requirement that a user should never be presented with an unexpected change of context. A full page submit, especially one accompanied by changed content, would usually be considered a change of context.
To alleviate this issue all components which will result in submitOnChange will have their label (or legend as appropriate) flagged with a warning message.
Note the accessibility issue described above.
To apply submitOnChange
to a supported component simple use the setter setSubmitOnChange(boolean)
:
// with component `field`
field.setSubmitOnChange(true);
Application of an action on change is not tied to the implementation of submitOnChange
. Such an action may be invoked if the component is a trigger for a WAjaxControl.
- Understanding SC 3.2.2
- Accessibility
- WAjaxControl is a more appropriate mechanism for undertaking actions invoked from input components.