5 Replies Latest reply on Nov 12, 2009 2:13 AM by garcimouche

    SEAM with RichFaces Questions

    garcimouche

      Hi all,


      I'm new to SEAM and RichFaces. I would like to integrate a search capability in my current xhtml for a given field. I decided to display a modal panel after the user clicks a link near my field. In this modal pane, I would like to activate the search with a a:commandButton component but this doesn't work. The only way I get it work is with the a:support tag embedded in my search field (code here after).
      When I use my the ajax command button it seems that the search input field which is in the same region is not sent to the server. Any help would be greatly appreciated.


      working code:


           <rich:modalPanel id="modalPanel">
                <f:facet name="header">
                                    Modal panel
                                </f:facet>
                <f:facet name="controls">
                     <h:graphicImage value="/img/false.png" style="cursor:pointer"
                          onclick="#{rich:component('modalPanel')}.hide()" />
                </f:facet>
      
      
                <rich:panel>
                     <f:facet name="header">Search Filter</f:facet>
                          <h:inputText id="partyName" value="#{partyList.party.name}">
                               <a:support event="onblur" reRender="xxx" ajaxSingle="true" />
                          </h:inputText>
                </rich:panel>
      
                <rich:panel id="xxx">
                     <f:facet name="header">Party Search Results (#{empty partyList.resultList ? 0 :
       (partyList.paginated ? partyList.resultCount : partyList.resultList.size)})
                              </f:facet>
                     <h:outputText
                          value="The party search returned no results."
                          rendered="#{empty partyList.resultList}" /> 
                          
                          <rich:dataTable
                          id="partyListGrid" var="_party" value="#{partyList.resultList}"
                          rendered="#{not empty partyList.resultList}">
                          <h:column>
                               <h:outputText value="#{_party.id}" />
                          </h:column>
                          <h:column>
                               <h:outputText value="#{_party.carrierCode}" />
                          </h:column>
                     </rich:dataTable>
                </rich:panel>
      
                <a href="#" onclick="#{rich:component('modalPanel')}.hide()">Done</a>
           </rich:modalPanel> 




      refuse to work:


                ......(same code)
                      <rich:panel>
                     <f:facet name="header">Search Filter</f:facet>
      *               <a:region>
      *                    <h:inputText id="partyName" value="#{partyList.party.name}">
                          </h:inputText>
      **                    <a:commandButton ajaxSingle="true" reRender="xxx" value="Search"/>
      *               </a:region>
      *          </rich:panel>
                      (same code)......
      



        • 1. Re: SEAM with RichFaces Questions
          swd847

          ajaxSingle means that the value of partyName will not be sent to the server, and the code wont work. Don't use ajaxSingle and it should work.

          • 2. Re: SEAM with RichFaces Questions
            garcimouche

            ajaxSingle means that the value of "partyName" will not be sent to the server, and the code wont work. Don't use ajaxSingle and it should work.

            it's still not working....I'm spending all my time struggling with this bloody rich faces tag.. I wonder if it would be easier with icefaces....

            • 3. Re: SEAM with RichFaces Questions
              swd847

              Try moving the region to contain the result list as well.

              • 4. Re: SEAM with RichFaces Questions
                kragoth

                Yeah, I'm pretty sure there are some restrictions about what you can re(render) outside the a4j:region on an ajax request. Can't remember all the rules but check out THIS to see if it helps.


                You may want to try setting the renderRegionOnly attribute of you a4j:region to false and see if that helps.

                • 5. Re: SEAM with RichFaces Questions
                  garcimouche

                  Thanks for the link, from the doc, I've just read the following:


                  To work properly, the <rich:modalPanel> should always be placed outside 
                  the original <h:form>. For performing submits from within the <rich:modalPanel> it must include its own <h:form>.
                  In order to avoid a bug in IE, the root node of the dialog is moved on the top 
                  of a DOM tree.
                  


                  ....sometimes it's good to read doc ;-)