2 Replies Latest reply on Feb 12, 2010 4:02 AM by Ilya Shaikovsky

    Dynamically load a page fragement in rich:outputpanel

    cal kennedy Newbie
      I have a rich:ouputpanel with multiple rich:panel components.  My goal is to load edit.jspf with the data related to the record they select from the grid (Edit button).
      I know that both jspfs are loaded when index.jsp is so right now when edit is clicked edit.jspf will appear but fields will be empty.  Is there any way i can force this page to reload with the correct data?
      I am able to get the record Id from the ActionEvent of Edit click but i am not sure how to force edit.jspf to use that Id to reload the page. 

      My code:
                <%@include file="main.jspf"%>
      <div> footer</div>

      main.jspf contains:
      <rich:outerpanel id="opMain">
           <rich:panel id="pnlOne" rendered="#{mybean.bOneRendered}">
                <%@include file="grid.jsfp">
           <rich:panel id="pnlTwo" rendered="#{mybean.bTwoRendered}">
                <%@include file="edit.jsfp">

      <subview id="subGrid">
      <rich:dataTable value="#{gridBean.resultset}" var="currentRow">  
                <f:facet name="header">
                          <h:outputText value="Last Update>
                <h:outputText value="#{currentRow.lastUpdate}"/>
                <f:facet name="header">
                      <h:outputText value="Edit"/>
                <a4j:commandLink value="Edit" actionListener="#{gridBean.lnkEditAction}" data="#{currentRow.Id" reRender="opMain"/>

      Any ideas?