2 Replies Latest reply on May 31, 2010 8:15 PM by ufonaut

    Hide rich:dataTable

      Hi,

       

      I'm developing search portlet with richfaces 3.3.3.

      In the search page there is search fields and table of results.

      When the page is first load, I don't want to show the table.

      How can I hide the rich:dataTable in the creation of the page and after click on the search button show him????

       

      I tried to do it with java script but it didn't worked.

       

      Tnx, Yaniv

        • 1. Re: Hide rich:dataTable
          nbelaevski

          "RichFaces Development" subspace is not for general usage questions: http://community.jboss.org/en/richfaces/dev, moving the thread to correct space.

          • 2. Re: Hide rich:dataTable
            ufonaut

            Have something like:

             

            {code:xml}
            <a4j:outputPanel id="resultsPanel">

            <rich:extendedDataTable  id="resultsTable" rendered="#{not empty myBean.resultsList}"
            ....
            </rich:extendedDataTable>
            </a4j:outputPanel>

            <a4j:commandButton action="#{myBean.doSearch}" reRender="resultsPanel"/>
            {code}

             

            There's a golden rule in RichFaces - If a component is conditionally rendered (ie. has a rendered= tag), then you should NEVER have it as a target in a reRendered= tag.  That's why the table is wrapped in the outputPanel above.