Question

I'm using <rich:select/> element for selecting one element from list, and a need an action after user changes selected element. I wrote this:

<rich:select ... >
    <f:selectItems ... />
    <a4j:ajax listener="#{...}" event="change" render="..."/>
</rich:select>

and faced with a problem: change event occurs only when <rich:select>'s focus is lost. And change event do not work at all when user selects it's first value (from empty default value).
How can I invoke an action immediately when selection have changed?

Was it helpful?

Solution

Use selectitem event:

<a4j:ajax listener="#{...}" event="selectitem" render="..."/>

From the Tag Library Doc:

onselectitem - Javascript code executed when an item is selected

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top