2 Replies Latest reply: Feb 18, 2008 11:01 AM by Jan Vervecken RSS

    ADF Faces : partial page rendering in f:subview

    Jan Vervecken
      hi

      Please consider this blog post, "ADF Faces: How-to issue a PPR event from a f:subview and how-to PPR of subviews" :
      http://thepeninsulasedge.com/frank_nimphius/2008/02/14/adf-faces-how-to-issue-a-ppr-event-from-a-fsubview-and-how-to-ppr-of-subviews/

      In this post, Frank Nimphius writes : "... PPR from a containing page to the subview - unfortunately - only works for the whole subview, which means that the included page is getting refreshed. Because the f:subview component does not support PR, you need to work with a wrapping ADF Faces container, like af:panelGroup ...".

      But, it looks like such partial page rendering in a subview can be done without a specific "wrapping ADF Faces container" like this ...
              <h:form id="firstPPRPageFormID">
                <af:panelPage title="firstPPRPage">
                  <af:panelHeader text="components on firstPPRPage">
                    <af:panelForm>
                      <af:panelLabelAndMessage label="dateUtil.currentDateAsString, with partial trigger">
                        <af:outputText value="#{dateUtil.currentDateAsString}"
                                       partialTriggers="firstSubviewID:firstSubviewCButton"/>
                      </af:panelLabelAndMessage>
                      <af:panelLabelAndMessage label="dateUtil.currentDateAsString">
                        <af:outputText value="#{dateUtil.currentDateAsString}"/>
                      </af:panelLabelAndMessage>
                      <f:facet name="footer">
                        <af:commandButton text="firstPPRPage button"
                                          id="firstPPRPageCButton"
                                          partialSubmit="true"/>
                      </f:facet>
                    </af:panelForm>
                  </af:panelHeader>
                  <f:subview id="firstSubviewID">
                    <jsp:include page="/firstSubview.jspx" flush="true"/>
                  </f:subview>
                </af:panelPage>
              </h:form>
      ... and where firstSubview.jspx contains something like this ...
        <af:panelHeader text="components on firstSubview">
          <af:panelForm>
            <af:panelLabelAndMessage label="dateUtil.currentDateAsString, with partial trigger">
              <af:outputText value="#{dateUtil.currentDateAsString}"
                             partialTriggers=":firstPPRPageFormID:firstPPRPageCButton"/>
            </af:panelLabelAndMessage>
            <af:panelLabelAndMessage label="dateUtil.currentDateAsString">
              <af:outputText value="#{dateUtil.currentDateAsString}"/>
            </af:panelLabelAndMessage>
            <f:facet name="footer">
              <af:commandButton text="firstSubview button" id="firstSubviewCButton"
                                partialSubmit="true"/>
            </f:facet>
          </af:panelForm>
        </af:panelHeader>
      Note the value ":firstPPRPageFormID:firstPPRPageCButton" for the partialTriggers attribute.

      see http://verveja.footsteps.be/~verveja/files/oracle/PartialPageRenderingInSubview-v0.01.zip (check README.txt)

      questions:
      (1) Why exactly does this approach seem to work?
      (2) Because of question (1), what could be potential issues with this approach?

      regards
      Jan Vervecken