myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Liegler <liegler.mau...@gmx.at>
Subject Help needed for working with f:subview/dynamic includes
Date Wed, 01 Feb 2006 03:30:50 GMT
Hi!

I am currently working through the tutorials of the „JSF in Action“
book. 

When I program any of the examples using subview/includes, I almost get
not to the expected results as demonstrated. I have put together some
tests which I put below in my posting. 

- Did anybody noticed my observed behaviours in some way? 
- How do you work with dynamic includes and subview – what is expected
to work and what not, what are the do’s and do not’s? 
- My setup is MyFaces 1.1.1, Java 5 and Tomcat 5.5.12(servlet 2.4/jsp
2.0) – What is your setup in the cases it works as expected? 
- Does a dynamically included but not existent jsp never throw an
exception? A statically included does. 

Thank you very much
Jörg


------------------------------------------------------------------------
--------
A) This does work in body of f:view (static and dynamic includes, with
and without subview)

<jsp:include page="includes/header.jsp" />

<jsp:include page="includes/header.jsp" flush="false"/>

<jsp:include page="includes/header.jsp" flush="true"/>

<f:subview id="header">
  <jsp:include page="includes/header.jsp" flush="true"/>
</f:subview>

<f:subview id="header">
  <jsp:include page="includes/header.jsp" flush="false"/>
</f:subview>

------------------------------------------------------------------------
--------
B) This does work in body of h:panelgrid (static includes without
subviews)

 <h:form>
        <h:panelGrid columns="2" cellpadding="5"
             footerClass="project-background"
             styleClass="project-background" rowClasses="project-row">
             <f:facet name="header">
                  <h:panelGrid columns="1" width="100%"
                       cellpadding="3" styleClass="project-background"
                       headerClass="page-header">
                       <f:facet name="header">
                            <h:outputText value="Approve a project" />
                       </f:facet>
                       <h:outputText value="Application messages."
                            styleClass="errors" />
                  </h:panelGrid>
             </f:facet>
             <%-- Panel data elements --%>
             <%@ include file="includes/project_info.jsp"%>
             <%@ include file="includes/project_artifacts.jsp"%>
             <f:facet name="footer">
                  <h:panelGroup>
                       <%@ include
file="includes/project_comments.jsp"%>
                       <%-- Button panel --%>
                       <h:panelGrid columns="2"
                            rowClasses="table-odd-row">
                            <h:commandButton value="Approve"
                                 action="approve" />
                            <h:commandButton value="Cancel"
                                 action="cancel" immediate="true" />
                       </h:panelGrid>
                  </h:panelGroup>
             </f:facet>
        </h:panelGrid>
   </h:form>

------------------------------------------------------------------------
--------
C) This does not work in body of h:panelgrid but I guess that it should
(static includes with subviews)

Same code around as B), but now inside subview. project_info and
project_artifacts are not rendered by panelGrid but the whole included
content is inside ONE row. NO EXCEPTION is thrown(AFAIK) or at least
logged with level trace. My loggers are set for javax.faces,
org.apache.myfaces, org.apache.tomcat, org.apache.catalina. 
...
             <%-- Panel data elements --%>
             <f:subview id="project_info">
                  <%@ include file="includes/project_info.jsp"%>
             </f:subview>
             <f:subview id="project_artifacts">
                  <%@ include file="includes/project_artifacts.jsp"%>
             </f:subview>
             <f:facet name="footer">
                  <h:panelGroup>
                  <f:subview id="project_comments">
                  <%@ include file="includes/project_comments.jsp"%>
             </f:subview>
...

------------------------------------------------------------------------
--------
D) This does not work in body of h:panelgrid but I guess that it should
(dynamic includes with and without subviews)

Same code around as in B), but content gets „swollowed“ while rest is
rendered. My loggers are set for javax.faces, org.apache.myfaces,
org.apache.tomcat, org.apache.catalina.
...
<jsp:include page="includes/project_info.jsp" flush="true"/>
...

...
<jsp:include page="includes/project_info.jsp" flush="false"/>
...

...
<f:subview id="project_info">
  <jsp:include page="includes/project_info.jsp" flush="false"/> 
</f:subview>
...

...
<f:subview id="project_info">
  <jsp:include page="includes/project_info.jsp" flush="true"/> 
</f:subview>
...





Mime
View raw message