2 Replies Latest reply on Sep 23, 2013 11:32 AM by Alexandre Granier

    toolbar binding in SessionScoped lead to loose style

    Alexandre Granier Newbie

      Hi,

       

      I use a rich:toolbar binding to dynamically create menus. I met an issue in specific case.

       

      consider this jsf page

       

      <h:form id="form">
                      <rich:toolbar binding="#{myBean.toolbar}">
                          <rich:dropDownMenu>
                          <f:facet name="label">
                          <h:panelGroup id="editMenu">
                              <h:outputText value="edit" />
                          </h:panelGroup>
                          </f:facet>
                              <rich:menuItem label="menuitem" mode="server" action="#{myBean.action}"/>
                          </rich:dropDownMenu>
                      </rich:toolbar>
      </h:form>
      
      

       

      and this associated managed bean (in SessionScoped)

       

      @ManagedBean(name="myBean")
      @SessionScoped
      public class MyBean {
      
          private UIToolbar toolbar;
      
           public MyBean{}
      
          public String action() {
              System.out.println("action");
              return "";
          }
      
      public UIToolbar getToolbar() {
              return toolbar;
          }
      
          public void setToolbar(UIToolbar toolbar) {
              this.toolbar = toolbar;
          }
      
      
      
      
      
      
      
      
      
      
          }
      
      

       

      Using the "itemmenu" menu reload the page and make the menu bar to loose its style. The same problem occurs if you reload / refresh the page.

      Removing the binding of the toolbar element fix the problem.

      Note that the js console shows some errors:

      Richfaces is not define

      ReferenceError: toolbarHandlers is not defined

       

      info : mojarra 2.1.6 RF 4.3.3

      Any ideas to solve this ?