1 Reply Latest reply on May 7, 2008 4:00 PM by trixom

    Selecting item from list

    trixom

      Hi,


      I am trying to get the following scenario working:


      Start a conversation
      Show a list of information
      Select an item from list
      Execute actions on this item (within the conversation)


      I have tried using the scrollableDatatable but ran into a problem that to get it to work you need to bind it to a backing bean. This however cannot work in a conversation, so all the actions I try to use that require items from the conversation fail...


      I have tried using the orderingList and activeitem but this has a lot of issues when using different browsers.


      Could someone point me in the right direction?


      Thanks,


      Tom

        • 1. Re: Selecting item from list
          trixom

          Somehow just posting here always seems to help:


          This is how I got it working:


          basically i use the xxxList.java object generated by seam-gen.


          I add the following items:


          private Country selectedCountry;
          
          ...
          public Country getSelectedCountry()
          {
             return this.selectedCountry;
          }
             
          public void setSelectedCountry(Country selectedCountry)
          {
             this.selectedCountry = selectedCountry;
          }
          



          in the List.xhtml I have the following (parentList is CountryList):


          <rich:scrollableDataTable
               value="#{parentList.resultList}" 
               var="country"
               height="200px"
               width="540px"
               rendered="#{not empty parentList.resultList}">
               <a:support
                    event="onRowClick"
                    action="#{parentList.setSelectedCountry(country)}"
                    reRender="countryMenuPanel, countrySubPanel" />
               <h:column>
                    <f:facet name="header">
                         <s:link styleClass="columnHeader"
                              value="#{messages.id} #{parentList.order=='country.id asc' ? messages.down : ( parentList.order=='country.id desc' ? messages.up : '' )}">
                              <f:param name="countryOrder"
                                   value="#{parentList.order=='country.id asc' ? 'country.id desc' : 'country.id asc'}" />
                         </s:link>
                    </f:facet>
                    <h:outputText value="#{country.id}" />
                </h:column>
          ...



          The panels that are rerendered are used to display the subobjects of the selected object and a menu in which I can delete and edit the selected object.


          Thanks,


          Tom