Skip to content

SubmitOnChange

Mark Reeves edited this page Dec 28, 2017 · 3 revisions

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.

Accessibility

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.

Using submitOnChange

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.

Further information

Clone this wiki locally