[richfaces-dev] "Necessity for events that represents evident change of component's value (both, manually or externally)"

Lukáš Fryč lukas.fryc at gmail.com
Mon Oct 21 06:19:53 EDT 2013


I would like to address an issue that arose from a discussion
https://issues.jboss.org/browse/RF-13180 .

When one reacts on changes of value, he can use 'change' event that have
defficiency coming from classic HTML <input>:

- the 'change' event is fired after 'blur' event when the value changed
between a focus and a subsequent blur event

This means in component like <r:calendar> or <r:autocomplete>, a 'change'
event is not fired when input is externally changed by selection of a value
from popup, but only when a value is changed and then input is blurred.

This has downside in form of a bad experience:

* client-side validation is triggered when autocomplete is blurred, but it
could be validated right after selection from a suggestion box
* so when one want to react on changes, he need to use behavior-based (as
opposed to semantically-based) events, such as 'onkeypress', 'onselect'

----

This defficiency could be solved by introducing new event: e.g.
'valuechanged' which would be defined as:

* event 'valuechanged' is triggered when component's input is blurred or
the value is changed externally

However, this solutions has its own drawback coming from a fact, that this
event must be supported by library - so e.g. common JSF components won't be
supported (unless we provide a shim for them - e.g. event triggering
emulation).

~ Lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/richfaces-dev/attachments/20131021/49598814/attachment.html 


More information about the richfaces-dev mailing list