webtier@glassfish.java.net

JSF: f:ajax "execute" not working properly when adding "render" targeting

From: <forums_at_java.net>
Date: Thu, 29 Sep 2011 07:54:58 -0500 (CDT)

Hello Glassfish users,

Mentally replace [] by <>, because tags are interpreted in the forum.

This code is working fine, i.e. *setCurrentComponent()* is called when an
item is selected:

/[h:body]
   [h:form]
      [h:selectOneMenu
value="#{monitoringAdministrationController.*currentComponent*}"]
         [f:ajax event="change" *execute="@this"*/]
         [f:selectItems
value="#{monitoringAdministrationController.componentNames}"/]
      [/h:selectOneMenu]
   [/h:form]
[/h:body]/

Now I want a second menu content to be updated when an item is selected in
the first one. But when I add the render attribute with the ID of the second
menu, *setCurrentComponent() is not called anymore*!  

/[h:body]
   [h:form]
      [h:selectOneMenu
value="#{monitoringAdministrationController.currentComponent}"]
         [f:ajax event="change" execute="@this" *render="modelList"*/]
         [f:selectItems
value="#{monitoringAdministrationController.componentNames}"/]
      [/h:selectOneMenu]
      [h:selectOneMenu id="*modelList*"
value="#{monitoringAdministrationController.currentModel}"]
         [f:selectItems
value="#{monitoringAdministrationController.modelNames}"/]
      [/h:selectOneMenu]
   [/h:form]
[/h:body]/

And if I take the second menu out of the form, the modelList ID is not found
(even if ID's are DOM scoped):

/[h:body]
   *[h:form]
*      [h:selectOneMenu
value="#{monitoringAdministrationController.currentComponent}"]
         [f:ajax event="change" execute="@this" render="modelList"/]
         [f:selectItems
value="#{monitoringAdministrationController.componentNames}"/]
      [/h:selectOneMenu]
   *[/h:form]
*   [h:selectOneMenu id="modelList"
value="#{monitoringAdministrationController.currentModel}"]
      [f:selectItems
value="#{monitoringAdministrationController.modelNames}"/]
   [/h:selectOneMenu]/ /[/h:body]/   Does someone have an explanation
concerning this strange behaviour? Thanks a lot!   JM


--
[Message sent by forum member 'JeanMeurtrier']
View Post: http://forums.java.net/node/848286