You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ha...@apache.org on 2008/11/23 05:01:02 UTC

svn commit: r719950 - in /myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp: WEB-INF/faces-config.xml home.jsp renderOne.jsp

Author: hazems
Date: Sat Nov 22 20:01:02 2008
New Revision: 719950

URL: http://svn.apache.org/viewvc?rev=719950&view=rev
Log:
Adding renderOne example JSP pages and config.

Added:
    myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/renderOne.jsp
Modified:
    myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml
    myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/home.jsp

Modified: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml?rev=719950&r1=719949&r2=719950&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml Sat Nov 22 20:01:02 2008
@@ -23,4 +23,9 @@
     	<managed-bean-class>org.apache.myfaces.commons.exporter.ExporterBean</managed-bean-class>
     	<managed-bean-scope>request</managed-bean-scope>
     </managed-bean>    
+    <managed-bean>
+    	<managed-bean-name>renderOne</managed-bean-name>
+    	<managed-bean-class>org.apache.myfaces.commons.renderone.RenderOneBean</managed-bean-class>
+    	<managed-bean-scope>request</managed-bean-scope>
+    </managed-bean>       
 </faces-config>

Modified: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/home.jsp
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/home.jsp?rev=719950&r1=719949&r2=719950&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/home.jsp (original)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/home.jsp Sat Nov 22 20:01:02 2008
@@ -53,6 +53,9 @@
             <h:outputLink value="convertEnum.jsf">
                 <f:verbatim>ConvertEnum</f:verbatim>
             </h:outputLink>
+            <h:outputLink value="renderOne.jsf">
+                <f:verbatim>renderOne - render the first child component by order or by index</f:verbatim>
+            </h:outputLink>                
             <h:outputLink value="exporter.jsf">
                 <f:verbatim>Exporter - Export datatable contents as an excel file or as a pdf file</f:verbatim>
             </h:outputLink>                   

Added: myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/renderOne.jsp
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/renderOne.jsp?rev=719950&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/renderOne.jsp (added)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/webapp/renderOne.jsp Sat Nov 22 20:01:02 2008
@@ -0,0 +1,60 @@
+<%@ page session="false" contentType="text/html;charset=utf-8" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://myfaces.apache.org/commons/components" prefix="mc" %>
+<html>
+
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+//-->
+
+<%@include file="inc/head.inc" %>
+
+<body>
+<f:view>
+    <h:form>
+
+        <h:outputText value="Output:" />
+        <h:panelGrid columns="2">
+            <h:outputText value="'first' will display the first rendered child component only (will render only B):" />
+            <mc:renderOne>
+                <h:outputText value="<b>A - FirstItem</b>" rendered="#{renderOne.ARendered}" escape="false"/>
+                <h:outputText value="<b>B - SecondItem</b>" rendered="#{renderOne.BRendered}" escape="false"/>
+                <h:outputText value="<b>C - ThirdItem</b>" rendered="#{renderOne.CRendered}" escape="false"/>
+                <h:outputText value="<b>D - FourthItem</b>" rendered="#{renderOne.DRendered}" escape="false"/>
+            </mc:renderOne>
+
+            <h:outputText value="'index' will display the third component only (will render only C):" />
+            <mc:renderOne type="index" value="#{renderOne.index}">
+                <h:outputText value="<b>A - FirstItem</b>" rendered="#{renderOne.ARendered}" escape="false"/>
+                <h:outputText value="<b>B - SecondItem</b>" rendered="#{renderOne.BRendered}" escape="false"/>
+                <h:outputText value="<b>C - ThirdItem</b>" rendered="#{renderOne.CRendered}"  escape="false"/>
+                <h:outputText value="<b>D - FourthItem</b>" rendered="#{renderOne.DRendered}" escape="false"/>
+            </mc:renderOne>
+        
+        </h:panelGrid>
+        
+    </h:form>
+</f:view>
+
+<%@include file="inc/page_footer.jsp" %>
+
+</body>
+</html>