47. Enhancing JSF 2.0 Components Ajax : Declarative Solution : Nested <f:ajax /> <h:commandButton ...> <h:commandButton...> <f:ajax event=”action” /> <f:ajax /> </h:commandButton> </h:commandButton> Do exactly the same thing since “action” is the default event for commandButton components. <h:commandButton...> <h:commandButton...> <f:ajax event=”valueChange”/> <f:ajax event=”mouseover”/> </h:commandButton> </h:commandbutton> Error: valueChange is not a supported event for commandButton components! JavaScript events supported too.
48. Enhancing JSF 2.0 Components Ajax : Declarative Solution : <f:ajax /> Regions <f:ajax> <h:panelGrid> <h:inputText id=”text1”/> <h:commandButton id=”button1” /> </h:panelGrid> </f:ajax> Ajax applied to “text1” and “button1”. Ajax not applied to panelGrid since there is no default event associated with it.
49. Enhancing JSF 2.0 Components Ajax : Declarative Solution : <f:ajax /> Combined <f:ajax event=”click”> <h:panelGrid id=”grid1”> <h:inputText id=”text1”/> <h:commandButton id=”button1”> <f:ajax event=”mouseover”/> </h:commandButton> </h:panelGrid> </f:ajax> Ajax applied to “grid1” and “text1” for “onlick” event. Ajax applied to “button1” for “mouseover” event as well.