8 Replies Latest reply on Sep 17, 2010 8:56 AM by lvdberg

    reRender in <ui:include How To Do

    leod38

      Hello,


      I have any problem and I do not find solution after search .


      I want to include Page1.xhtml and Page2.xhtml into mainPage.xhtml
      in Page1.xhtml i want to reRender a form into Page2.xhtml


      mainPage.xhtml looks like this :




      ... 
      <h:form>
      
       <!-- Product Search part -->
       <ui:include src="/include/productsearch.xhtml"/>
      
       <!-- Product Selection-->
       <ui:include src="/include/productselection.xhtml"/>
      
       ...
      </h:form>





      and productsearch.xhtml is look like this :




      <a4j:commandButton styleClass="leftWithMargin" id="mysearch" action="#{ProductSelectionBean.LoadProductSelectionDataTable(NewProductBean.typeCompare,NewProductBean.productCodeWildCard,NewProductBean.activityproduct,NewProductBean.typeproduct,NewProductBean.typecriteria)}" image="/img/search.png" reRender="productsearch">
                                      <rich:toolTip value="Search"></rich:toolTip>
                              </a4j:commandButton>





      and productselection.xhtml is look like this :




      <rich:dataTable styleClass="newProductProductSelection" value="#{ProductSelectionBean.productSelectionCollection}" id="productsearch" var="productsearch" rows="15">
                                              <rich:column id="select" styleClass="w20">
                                                      <f:facet name="header">
                                                              <h:outputText value="SELECT" />
      ...
      





      I know that is not possible to do that , my question is how to do with other method
      Please give me an exemple


      Thanks in advance


      leod

        • 1. Re: reRender in <ui:include How To Do
          lvdberg

          Hi,


          Maybe I am missing something, but I think it is really possible to do what you want.


          First of all you should hide the second page if there is no result and secondly it should be made visible when there is a result.



          Try the following:




          <a4j:outputPanel id="secondPanel">
          <s:div rendered="#{not empty ProductSelectionBean.productSelectionCollection}">
          <rich:dataTable styleClass="newProductProductSelection" value="#{ProductSelectionBean.productSelectionCollection}" id="productsearch" var="productsearch" rows="15">
                                                  <rich:column id="select" styleClass="w20">
                                                          <f:facet name="header">
                                                                  <h:outputText value="SELECT" />
          ...
          
          </s:div>
          
          </a4j:outputPanel>





          and change the reRender attribute of the button to




          reRender="secondPanel"





          This should work.


          Leo


          P.S. This is not really a Seam question, but can be better asked on the RichFaces forum.






          • 2. Re: reRender in <ui:include How To Do
            leod38

            Thanks , I understand what to you say
            But i really want to include page because if i do that , the xhtml page make 2000 line
            I want to create module panel and include for each page the good panel i want .

            • 3. Re: reRender in <ui:include How To Do
              amitev

              Use a4j:include for this.

              • 4. Re: reRender in <ui:include How To Do
                lvdberg

                Hi,


                The s:div tag also ha a rendered attribute, so content will not be included if the condition you put in the rendered attribute is not met.


                Leo

                • 5. Re: reRender in <ui:include How To Do
                  leod38

                  I speak about reRender and not about rendered


                  I want to reload a form from include1 into include2

                  • 6. Re: reRender in <ui:include How To Do
                    lvdberg

                    Hi,


                    The thing I understand is that you want to dynamically reRender a part of your page which is in the included panel productselection.xhtml. If you expect a huge result, you should paginate your response and in this way limit the result to a maximum number of rows, or use a dynamic (paged) scrolling table. Both components are in the Rich-libraries. To create a scrollable resultset Seam has a great Query component which you should extend and feed with the Criteria you enter in your search panel.


                    Leo


                    • 7. Re: reRender in <ui:include How To Do
                      leod38

                      I'm sorry , my English is so bad !


                      I try to explain better


                      I have a main page with
                      include1 : productsearch
                      and include2 : productselection


                      when user complete search the commandbutton reRender productselection tab
                      (that is what i want)


                      actually productsearch and productselection are in the same page .
                      now i want to cut in three par : main , productselection and productsearch


                      • 8. Re: reRender in <ui:include How To Do
                        lvdberg

                        Hi,


                        The solutions provided by Adrian and myself should be sufficient to solve your problem.


                        Leo