You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2011/07/15 14:53:01 UTC

svn commit: r1147129 - in /myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp: best-practice/ content/51/ tobago-resource/html/standard/standard/property/

Author: lofwyr
Date: Fri Jul 15 12:53:01 2011
New Revision: 1147129

URL: http://svn.apache.org/viewvc?rev=1147129&view=rev
Log:
Sample related to TOBAGO-315: Support for Facelets Tag <ui:repeat>

Added:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/51/
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/51/for-each.xhtml
      - copied, changed from r1146579, myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/for-each.xhtml
Removed:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/for-each.jsp
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/for-each.xhtml
Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml

Copied: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/51/for-each.xhtml (from r1146579, myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/for-each.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/51/for-each.xhtml?p2=myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/51/for-each.xhtml&p1=myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/for-each.xhtml&r1=1146579&r2=1147129&rev=1147129&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/for-each.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/51/for-each.xhtml Fri Jul 15 12:53:01 2011
@@ -15,57 +15,63 @@
  * limitations under the License.
 -->
 
-<f:view locale="#{clientConfigController.locale}"
-        xmlns:tc="http://myfaces.apache.org/tobago/component"
-        xmlns:tx="http://myfaces.apache.org/tobago/extension"
-        xmlns:ui="http://java.sun.com/jsf/facelets"
-        xmlns:h="http://java.sun.com/jsf/html"
-        xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core">
-  <tc:loadBundle basename="overview" var="overviewBundle"/>
-  <tc:page applicationIcon="icon/favicon.ico" id="page" width="600px" height="400px">
-    <tc:box label="Best Practice - For Each">
+<ui:composition template="/WEB-INF/tags/layout/overview.xhtml"
+                xmlns:tc="http://myfaces.apache.org/tobago/component"
+                xmlns:tx="http://myfaces.apache.org/tobago/extension"
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core"
+                xmlns:c="http://java.sun.com/jstl/core">
+  <ui:param name="title" value="Best Practice - For Each"/>
+  <tc:panel>
+    <f:facet name="layout">
+      <tc:gridLayout rows="100px;fixed;fixed;fixed;*"/>
+    </f:facet>
+
+    <tc:panel>
       <f:facet name="layout">
-        <tc:gridLayout rows="fixed;100px;fixed;fixed;fixed;*"/>
+        <tc:flowLayout />
       </f:facet>
+      <tc:out escape="false" value="#{overviewBundle.foreach_text}"/>
+    </tc:panel>
+
+    <tc:form>
+      <tc:panel>
+        <f:facet name="layout">
+          <tc:gridLayout columns="*;100px"/>
+        </f:facet>
+
+        <c:forEach items="#{birdController.birds}" var="bird">
+          <tx:in value="#{bird.size}" label="#{bird.name}"/>
+          <tc:button label="Select" action="#{bird.select}"/>
+        </c:forEach>
+
+        <!--XXX not working with the layout manager-->
+        <!--
+        <ui:repeat value="#{birdController.birds}" var="bird">
+          <tx:in value="#{bird.size}" label="#{bird.name}"/>
+          <tc:button label="Select" action="#{bird.select}"/>
+        </ui:repeat>
+-->
+      </tc:panel>
+    </tc:form>
+
+    <tc:form>
+      <tc:panel>
+        <f:facet name="layout">
+          <tc:gridLayout columns="120px;2*;100px"/>
+        </f:facet>
+
+        <tc:in value="#{birdController.newBirdName}" required="true"/>
+        <tc:in value="#{birdController.newBirdSize}" required="true">
+          <f:validateLongRange minimum="1"/>
+        </tc:in>
+        <tc:button label="Add" action="#{birdController.addNewBird}"/>
+      </tc:panel>
+    </tc:form>
+
+    <tc:out value="#{birdController.status}"/>
 
-      <tc:messages/>
+    <tc:panel/>
 
-      <!--XXX not working with the layout manager-->
-      
-      <tc:out escape="false"
-              value="Is is possible to use the ui:repeat tag of the Facelets to iterate over a list. &lt;br/>&lt;b>Warning:&lt;/b> &lt;br/>This example is broken with the layout manager in the moment! The iterated components are on top of each other."/>
-
-      <tc:form>
-        <tc:panel>
-          <f:facet name="layout">
-            <tc:gridLayout columns="*;100px"/>
-          </f:facet>
-
-          <ui:repeat value="#{birdController.birds}" var="bird">
-            <tx:in value="#{bird.size}" label="#{bird.name}"/>
-            <tc:button label="Select" action="#{bird.select}"/>
-          </ui:repeat>
-        </tc:panel>
-      </tc:form>
-
-      <tc:form>
-        <tc:panel>
-          <f:facet name="layout">
-            <tc:gridLayout columns="120px;2*;100px"/>
-          </f:facet>
-
-          <tc:in value="#{birdController.newBirdName}" required="true"/>
-          <tc:in value="#{birdController.newBirdSize}" required="true">
-            <f:validateLongRange minimum="1"/>
-          </tc:in>
-          <tc:button label="Add" action="#{birdController.addNewBird}"/>
-        </tc:panel>
-      </tc:form>
-
-      <tc:out value="#{birdController.status}"/>
-
-      <tc:panel/>
-
-    </tc:box>
-  </tc:page>
-</f:view>
+  </tc:panel>
+</ui:composition>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml?rev=1147129&r1=1147128&r2=1147129&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml Fri Jul 15 12:53:01 2011
@@ -362,6 +362,13 @@
 ...</entry>
   <entry key="theme_photo">Photo of the location</entry>
 
+  <entry key="foreach_text">
+    There are two possibilities to use iterators:&lt;br/>
+    This example uses &lt;b>&amp;lt;c:forEach&gt;&lt;/b>. It works well with the layout manager.&lt;br/>
+    Using &lt;b>&amp;lt;ui:repeat&gt;&lt;/b> doesn't work with the grid layout manager in the moment.
+    The iterated components are on top of each other in the HTML document,
+    because they got have all the same position attributes.&lt;br/></entry>
+
   <!-- faceletsAsResources -->
   <entry key="faceletsAsResources_text">
     This example demonstrates how to load parts of the view of an application from a library jar file.