5 Replies Latest reply on Apr 22, 2009 4:07 PM by scott duke

    Passing Param to List

    scott duke Novice

      I have an AddressList.xhtml that has an ui:include to display the results from a search.


      <ui:include src="/role/admin/AddressTable.xhtml">
                  <ui:param name="addressFrom" value="/role/admin/AddressList"/>
      </ui:include> 
      



      Is there a way to pass the ui:param to the AddressList.java? The reason I am wanting to do this is because I am using the AddressTable.xhtml multiple times. Based upon where it is used, I am displaying certain columns and want to adjust the sorting of the list according from where the table is used.



        • 1. Re: Passing Param to List
          Zoltan Tiringer Newbie

          In AddressTable.page.xml you can define params (if you used seam-gen then sort and dir is already there for the sorting)

          • 2. Re: Passing Param to List
            scott duke Novice

            Yes, I am using seam-gen. All of the columns are capable of being sorted. My params in AddressList.page.xml is


            <param name="addressListFirstResult" value="#{addressList.firstResult}" />
            <param name="addressListSort" value="#{addressList.orderColumn}"/>
            <param name="addressListDir" value="#{addressList.orderDirection}" />
            



            I would need to set the sort on my AddressList.xhtml.

            • 3. Re: Passing Param to List
              scott duke Novice

              If I separate the AddressList.page.xml to where the sorting and direction is within the AddressTable.page.xml and run with this, it appears that the AddressTable.page.xml is not seen. The sorting works fine when the params are within the AddressList.page.xml.


              So, my question now is this...


              When you use an ui:include like explained above and then have an AddressList.page.xml can you have an AddressTable.page.xml, where the sort params are defined there? If so, then how can I get the sorting to work?

              • 4. Re: Passing Param to List
                Zoltan Tiringer Newbie

                I would suggest that you check out how param passing works in the seam-gen xxxList pages with sort.xhtml included. As I can see this exactly does what you want to achieve.

                • 5. Re: Passing Param to List
                  scott duke Novice

                  Zoltan, can you provide me a link to the documentation you are referring to?


                  By the way, I did figure a way to achieve what I wanted by executing an action within the AddressList.page.xml.