0 Replies Latest reply on Mar 10, 2008 1:22 PM by rhinox

    PanelBar with dynamically rendered PanelBarItems is not work

    rhinox

      PanelBar doesn't consider PanelBarItems rendered dynamically, if you have:

      <rich:panelBar id="pb">
       <rich:panelBarItem id="pbi1" rendered="#{isPb1Rendered}">
       ...
       </rich:panelBarItem>
       <rich:panelBarItem id="pbi2" rendered="#{isPb2Rendered}">
       ...
       </rich:panelBarItem>
       <rich:panelBarItem id="pbi3" rendered="#{isPb3Rendered}">
       ...
       </rich:panelBarItem>
       <rich:panelBarItem id="pbi4" rendered="#{isPb4Rendered}">
       ...
       </rich:panelBarItem>
      </rich:panelBar>


      RichFaces always generate javascript code for the four of them even when some of the panel bar items are not rendered, this causes PanelBar to fails. The generated javascript code looks like:

      <![CDATA[
      new Richfaces.PanelBar('pb',{'items':[{'onleave':'','onenter':'','id':'pbi1'} ,{'onleave':'','onenter':'','id':'pbi2'} ,{'onleave':'','onenter':'','id':'pbi3'} ,{'onleave':'','onenter':'','id':'pbi4'} ] ,'onitemchange':''} );
      //]]>


      I've tested with the following versions:

      RichFaces 3.1.3 GA: Working!
      RichFaces 3.1.4 GA: Not working!
      RichFaces 3.1.5 SNAPSHOT: Not working!
      RichFaces 3.2.0 SNAPSHOT: Not working!

      PLEASE HELP!
      Thanks!