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

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

      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:graphicImage url="images/logotype.gif"/>
       <h:outputText value="#{center.centerID}"/>
       <h:outputText value="#{obj.centerID}"/>
       <h:panelGrid id="holder" >
       <s:link id="centerName" view="/centerdetail.seam" action="#{centerSearch.performSearch(center)}" value="#{center.displayName}"/>
       <h:outputFormat value="#{center.description}"/>
       <h:outputText value="#{messages.zeroresults}" rendered="#{searchResultList.rowCount==0 and basicSearch.researchCenterSearch}" />

      and this performSearch method in my centerSearch bean is as follows
       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
       protected List<? extends DomainObject> results;
       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