2 Replies Latest reply on Dec 22, 2006 11:25 AM by Fatima Idowu

    Using the pages.xml to pass a parameter

    Fatima Idowu Newbie

      Hi, I'm trying to understand how the pages.xml file is used to pass a parameter.
      I have the following in my pages.xml file

      <pages>
       <page view-id="/centerdetail.xhtml" action="#{centerSearch.performSearch(center.centerID)}">
       <param name="selectedCenter" value="#{center.centerID}"/>
       </page>
      </pages>
      


      the code in the page that request the centerdetail.xhtml page is
      <h:panelGroup id="centerResultsPanel" rendered="#{basicSearch.researchCenterSearch}">
       <h:dataTable id="researchcenterResults" var="center" value="#{searchResultList}" rendered="#{searchResultList.rowCount >0}">
       <h:column>
       <h:outputLink>
       <h:graphicImage url="images/logotype.gif"/>
       <h:outputText value="#{center.centerID}"/>
       <h:outputText value="#{obj.centerID}"/>
       </h:outputLink>
       </h:column>
       <h:column>
       <h:panelGrid id="holder" >
       <s:link id="centerName" view="/centerdetail.seam" action="#{centerSearch.performSearch(center)}" value="#{center.displayName}"/>
       <h:outputFormat value="#{center.description}"/>
       </h:panelGrid>
       </h:column>
       </h:dataTable>
       <h:outputText value="#{messages.zeroresults}" rendered="#{searchResultList.rowCount==0 and basicSearch.researchCenterSearch}" />
       </h:panelGroup>
      


      and this performSearch method in my centerSearch bean is as follows
      @SuppressWarnings("unchecked")
       public String performSearch(ResearchCenter id) {
       Query query;
       log.debug(" Searching for center by ID ");
       log.debug("Center ID: #0", id);
      
       return "success";
       }
      


      The center id is being appended to the url but is showing up as null in the server.log file

      2006-12-21 14:29:16,468 DEBUG [gov.nih.nci.cagrid.portal.command.CenterSearchBean] Center ID:null


      Does anyone know how to pass an object from a selected row in a datatable to a separate bean , ie my searchBean holds the following
      @DataModel("searchResultList")
       protected List<? extends DomainObject> results;
      
       @DataModelSelection()
       protected DomainObject domainObj;
      


      and I want to pass the object of the selected row to a centerBean.

      Any suggestions would be greatly appreciated.
      Thank you