1 Reply Latest reply on Oct 3, 2009 7:57 PM by bloodcell2

    Have a rich:datascroller + an a:commandlink inside rich:data

      Hello to all,

      I have a rich:dataTable that displays stuff, it has a rich:datascroller inside its footer, and I also have an a:commandButton for adding an item to my display list (this is done through a rich:modalPanel)

      I noticed a very user-friendly design would be to have the button also inside the table's footer (let's say: the button align to the footer's left, and the datascroller to its right).
      But I can't get them both to display:

      <f:facet name="footer">
      
       <rich:datascroller for="itemTable"
       id="sc"
       align="center"
       maxPages="100"
       renderIfSinglePage="false" />
      
       <a:commandButton value="Add an item"
       action="#{myBean.newItem}"
       oncomplete="Richfaces.showModalPanel('itemDetails');"
       reRender="itemDetails"
       ajaxSingle="true"
       immediate="true" />
      
      </f:facet>


      Also tried (cause I saw it somewhere) :

      <f:facet name="footer">
      
       <rich:column>
       <rich:datascroller for="itemTable"
       id="sc"
       align="center"
       maxPages="100"
       renderIfSinglePage="false" />
       </rich:column>
      
       <rich:column breakBefore="true">
       <a:commandButton value="Add an item"
       action="#{myBean.newItem}"
       oncomplete="Richfaces.showModalPanel('itemDetails');"
       reRender="itemDetails"
       ajaxSingle="true"
       immediate="true" />
       </rich:column>
      </f:facet>


      ... Which yielded wierd results (the scroller isn't displayed and the button is not inside the footer).

      Do you guys have any idea how to accomplish this ?
      (seems like a valid GUI design way)

      Thanks!

        • 1. Re: Have a rich:datascroller + an a:commandlink inside rich:

          I just realized that <f:facet> probably accepts only one UI component nested inside it, and that's why we should wrap the a:commandButton and rich:datascroller together inside an h:panelGroup or, as in my case, an h:panelGrid.
          (I then realized this was a dumb ass question, but if I already asked it - might as well answer it) :

          <f:facet name="footer">
          
           <h:panelGrid columns="2">
          
           <rich:datascroller for="itemTable"
           id="sc"
           align="center"
           maxPages="100"
           renderIfSinglePage="false" />
          
           <a:commandButton value="Add an item"
           action="#{myBean.newItem}"
           oncomplete="Richfaces.showModalPanel('itemDetails');"
           reRender="itemDetails"
           ajaxSingle="true"
           immediate="true" />
          
           </h:panelGrid>
          
          </f:facet>