3 Replies Latest reply on Mar 7, 2011 12:07 AM by ilya40umov

    How to set parameter at page scope

    satyakatti

      Hi All,

       

      I iterate thru a List and build my ExtendedDataTable. On double click of the row, I would like to display additional details pertaining to the selected row.

       

      This by all means I can do by setting property in my backing bean to the selected object and then build additional table/panel based on the object.

       

      But I would like to do this at page scope i.e when user selects a row, I dont want to set property in bean but would like to get the selected object at pagescope and build the table/panel.

       

      Can this be done?

       

      Regards,

      Satya

        • 1. How to set parameter at page scope
          ilya40umov

          You can pass a parameter within your request by using a4j:actionparam and you don't need to assign it to any variable in a bean because you can simply read any of request parameters from FacesContext. But in this case you will need to handle selection by your self.

          • 2. How to set parameter at page scope
            satyakatti

            Hi,

             

            Handling the selection means I cant use SimpleSelection for the table?

             

            In such case should I have to manually handle the row clicked events by some scripts?

             

            It would be helpful if you can provide some examples.

             

            Regards,

            Satya

            • 3. How to set parameter at page scope
              ilya40umov

              You should add somthing like this to your dataTable

              <rich:dataTable>

                                                  <a4j:support action="#{bean.select}" event="onRowClick">

              <a4j:actionparam name="itemId" value="#{currentItem.id}"/>

              </a4j:support>

                     </rich:dataTable>

              and then process parameter itemId from request in your bean.select method.