Pergunta

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?

Foi útil?

Solução

Use selectitem event:

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

From the Tag Library Doc:

onselectitem - Javascript code executed when an item is selected

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top