tags:

views:

16

answers:

1

Given for example a SelectOneMenu, I can trigger valueChangeListeners or rerendering of page fragments via f:ajax:

<h:selectOneMenu valueChangeListener="..." ... >
  <f:ajax render="@form" execute="@form" />
</h:selectOneMenu>

That's nice, but I want to do some more complicated stuff when the box changes (if validation is passed). Is there any possibility to call an action method on a bean using f:ajax when it's not attached to a UICommand component? Or, if not, how can I call a bean method in the "invoke application" phase when the value of the select box changes?

+1  A: 

<f:ajax> has a listener attribute. From the api docs, the listener attribute is a:

Method expression referencing a method that will be called when an AjaxBehaviorEvent has been broadcast for the listener

http://java.sun.com/javaee/javaserverfaces/2.0/docs/pdldocs/facelets/f/ajax.html

Brian Leathem
Thank you very much. Somehow I must have overlooked that...
FRotthowe