1 Reply Latest reply on Feb 28, 2006 4:02 PM by walki

    JSF: Problem with method binding.

    walki

      I've got a page binded to two beans: managerBean and imageViewer bean.

      managerBean is assosiated with two drop down boxes (SelectOneMenu). Each of them has a value change listener registered to update imageViewer bean and "submit()" jstl attached to onChange event:

      <h:form>
       <h:panelGrid columns="2" styleClass="menuPanelGrid">
       <h:panelGroup>
       <h:panelGrid columns="2">
       <h:selectOneMenu id="userSelect" value="#{manager.user}"
       title="Owner: "
       valueChangeListener="#{manager.userChanged}"
       onchange="submit();"
       styleClass="menuListMenu">
       <f:selectItems value="#{manager.users}"/>
       </h:selectOneMenu>
      
       <h:selectOneMenu id="gallerySelect" value="#{manager.gallery}"
       title="Gallery owner: "
       onchange="submit();"
       valueChangeListener="#{manager.galleryChanged}">
       <f:selectItems value="#{manager.galleries}"/>
       </h:selectOneMenu>
       </h:panelGrid>
       </h:panelGroup>
       </h:panelGrid>
      </h:form>
      
      


      The imageViewer is associated with an view.jsp:
      <h:form>
      <h:panelGrid binding="#{imageView.imageTiles}" />
      </h:form>


      The problem is that the getImageTiles from imageViewBean is called only once, when the page is loaded. When I am chanign the values in dropdown boxes, the returned HtmlPanelGrid is always the same (no updated is taken from getImageTiles method)

      Thanks for a any help



        • 1. Re: JSF: Problem with method binding.
          walki

          Hi,
          I've already found the workaround, not the real solution.

          The dataGrid is somehow cached, that is why the method is not called again. The solution I've found is to search the ViewRoot for th UI component, which is not refreshing and delete its children.

          If you have any better solutions for that problem, please reply to this thread.

          Thanks