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/13 02:15:11 UTC

svn commit: r713601 - in /myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp: WEB-INF/examples-config.xml home.jsp limitRendered.jsp renderOne.jsp

Author: hazems
Date: Wed Nov 12 17:15:11 2008
New Revision: 713601

URL: http://svn.apache.org/viewvc?rev=713601&view=rev
Log:
Adding <s:renderOne .../> examples.

Added:
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/renderOne.jsp
Removed:
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/limitRendered.jsp
Modified:
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml?rev=713601&r1=713600&r2=713601&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml Wed Nov 12 17:15:11 2008
@@ -513,10 +513,10 @@
     <managed-bean-scope>request</managed-bean-scope>
   </managed-bean>
   
-    <!-- managed bean for limitRendered -->
+    <!-- managed bean for renderOne -->
     <managed-bean>
-        <managed-bean-name>limitRendered</managed-bean-name>
-        <managed-bean-class>org.apache.myfaces.examples.limitrendered.LimitRenderedBean</managed-bean-class>
+        <managed-bean-name>renderOne</managed-bean-name>
+        <managed-bean-class>org.apache.myfaces.examples.renderone.RenderOneBean</managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
     </managed-bean>
   

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp?rev=713601&r1=713600&r2=713601&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp Wed Nov 12 17:15:11 2008
@@ -159,10 +159,10 @@
             
         </h:panelGrid>
 
-        <h:outputText value="Limit Rendered"/>
+        <h:outputText value="renderOne"/>
         <h:panelGrid style="padding-left:25px">
-            <h:outputLink value="limitRendered.jsf" >
-                <f:verbatim>Limit Rendered - limit the number of child components to render</f:verbatim>
+            <h:outputLink value="renderOne.jsf" >
+                <f:verbatim>renderOne - render the first child component by order or by index</f:verbatim>
             </h:outputLink>
         </h:panelGrid>
         

Added: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/renderOne.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/renderOne.jsp?rev=713601&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/renderOne.jsp (added)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/renderOne.jsp Wed Nov 12 17:15:11 2008
@@ -0,0 +1,61 @@
+<%@ 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/tomahawk" prefix="t"%>
+<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s"%>
+<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):" />
+            <s: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"/>
+            </s:renderOne>
+
+            <h:outputText value="'index' will display the third component only (will render only C):" />
+            <s: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"/>
+            </s:renderOne>
+        
+        </h:panelGrid>
+        
+    </h:form>
+</f:view>
+
+<%@include file="inc/page_footer.jsp" %>
+
+</body>
+</html>