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/01/28 16:04:01 UTC

svn commit: r1064717 - in /myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main: java/org/apache/myfaces/tobago/example/test/Attribute.java webapp/WEB-INF/faces-config.xml webapp/tc/attribute/ webapp/tc/attribute/attribute.xhtml

Author: lofwyr
Date: Fri Jan 28 15:04:01 2011
New Revision: 1064717

URL: http://svn.apache.org/viewvc?rev=1064717&view=rev
Log:
Attribute test page

Added:
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Attribute.java
      - copied, changed from r1059812, myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Partially.java
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/attribute/
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/attribute/attribute.xhtml
      - copied, changed from r1059812, myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/in/in.xhtml
Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml

Copied: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Attribute.java (from r1059812, myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Partially.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Attribute.java?p2=myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Attribute.java&p1=myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Partially.java&r1=1059812&r2=1064717&rev=1064717&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Partially.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Attribute.java Fri Jan 28 15:04:01 2011
@@ -17,9 +17,10 @@ package org.apache.myfaces.tobago.exampl
  * limitations under the License.
  */
 
-public class Partially {
+public class Attribute {
 
   private int counter;
+  private boolean condition;
 
   public void resetCounter() {
     counter = 0;
@@ -36,4 +37,12 @@ public class Partially {
   public void setCounter(int counter) {
     this.counter = counter;
   }
+
+  public boolean isCondition() {
+    return condition;
+  }
+
+  public void setCondition(boolean condition) {
+    this.condition = condition;
+  }
 }

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml?rev=1064717&r1=1064716&r2=1064717&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml Fri Jan 28 15:04:01 2011
@@ -125,6 +125,12 @@
     <managed-bean-scope>session</managed-bean-scope>
   </managed-bean>
 
+  <managed-bean>
+    <managed-bean-name>attribute</managed-bean-name>
+    <managed-bean-class>org.apache.myfaces.tobago.example.test.Attribute</managed-bean-class>
+    <managed-bean-scope>session</managed-bean-scope>
+  </managed-bean>
+
   <navigation-rule>
     <navigation-case>
       <from-outcome>navigation</from-outcome>

Copied: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/attribute/attribute.xhtml (from r1059812, myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/in/in.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/attribute/attribute.xhtml?p2=myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/attribute/attribute.xhtml&p1=myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/in/in.xhtml&r1=1059812&r2=1064717&rev=1064717&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/in/in.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/attribute/attribute.xhtml Fri Jan 28 15:04:01 2011
@@ -20,20 +20,62 @@
     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:f="http://java.sun.com/jsf/core"
+    xmlns:c="http://java.sun.com/jstl/core">
 
   <tc:page>
     <f:facet name="layout">
-      <tc:gridLayout rows="auto;auto;auto;*"/>
+      <tc:gridLayout rows="auto;auto;auto;auto;auto;auto;*" columns="250px;*"/>
     </f:facet>
     <tc:gridLayoutConstraint width="600px" height="300px"/>
 
-    <tc:in value="Some Value"/>
-    <tc:in value="Some Required Value" required="true"/>
+    <tc:label value="condition"/>
+    <tc:panel>
+      <f:facet name="layout">
+        <tc:gridLayout columns="*;*"/>
+      </f:facet>
+      <tc:selectBooleanCheckbox value="#{attribute.condition}"/>
+      <tc:button label="update"/>
+    </tc:panel>
 
-    <tc:button label="submit"/>
+    <tc:label value="simple output"/>
+    <tc:in readonly="true">
+      <tc:attribute name="value" value="Some Value from the tc:attribute"/>
+    </tc:in>
 
-    <tc:cell/>
+    <tc:label value="output over EL"/>
+    <tc:in readonly="true">
+      <tc:attribute name="value" value="#{attribute.counter}"/>
+    </tc:in>
+
+    <tc:label value="action"/>
+    <tc:button label="Click">
+      <tc:attribute name="action" value="#{attribute.reload}"/>
+    </tc:button>
+
+    <tc:label value="conditional action (#{attribute.condition})"/>
+    <tc:button label="Click">
+      <c:if test="#{attribute.condition}">
+        <tc:attribute name="action" value="#{attribute.reload}"/>
+      </c:if>
+    </tc:button>
+
+    <tc:label value="conditional action not (#{not attribute.condition})"/>
+    <tc:button label="Click">
+      <c:if test="#{not attribute.condition}">
+        <tc:attribute name="action" value="#{attribute.reload}"/>
+      </c:if>
+    </tc:button>
+
+    <tc:label value="conditional action (#{attribute.condition}) and link not (#{not attribute.condition})"/>
+    <tc:button label="Click">
+      <c:if test="#{attribute.condition}">
+        <tc:attribute name="action" value="#{attribute.reload}"/>
+      </c:if>
+      <c:if test="#{not attribute.condition}">
+        <tc:attribute name="link" value="/"/>
+      </c:if>   
+    </tc:button>
 
   </tc:page>
 </f:view>