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 2018/04/27 12:33:34 UTC

[myfaces-tobago] branch master updated (e9f41ff -> 898ed97)

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git.


    from e9f41ff  update docker readme
     new 850a96f  TOBAGO-1843: Demo
     new 898ed97  TOBAGO-1843: Demo

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../tobago/example/{test => demo}/Attribute.java   |  13 +-
 .../example/demo/HeaderFooterController.java       |  47 +++++++
 .../src/main/webapp/WEB-INF/faces-config.xml       |   6 -
 .../50-header+footer/x-header-footer-example.xhtml |  42 ++++--
 .../content/40-test/9000-attribute/attribute.xhtml |  79 ++++++++++++
 .../40-test/9000-attribute/mode-valueIfSet.xhtml   | 109 ++++++++++++++++
 .../40-test/90000-attic/attribute/attribute.xhtml  |  81 ------------
 .../90000-attic/attribute/mode-valueIfSet.js       |  39 ------
 .../90000-attic/attribute/mode-valueIfSet.xhtml    | 107 ---------------
 .../attribute/popup-modal.selenium.html            | 143 ---------------------
 .../90000-attic/attribute/popup-modal.xhtml        |  40 ------
 11 files changed, 273 insertions(+), 433 deletions(-)
 rename tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/{test => demo}/Attribute.java (81%)
 create mode 100644 tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/HeaderFooterController.java
 create mode 100644 tobago-example/tobago-example-demo/src/main/webapp/content/40-test/9000-attribute/attribute.xhtml
 create mode 100644 tobago-example/tobago-example-demo/src/main/webapp/content/40-test/9000-attribute/mode-valueIfSet.xhtml
 delete mode 100644 tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/attribute.xhtml
 delete mode 100644 tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/mode-valueIfSet.js
 delete mode 100644 tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/mode-valueIfSet.xhtml
 delete mode 100644 tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/popup-modal.selenium.html
 delete mode 100644 tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/popup-modal.xhtml

-- 
To stop receiving notification emails like this one, please contact
lofwyr@apache.org.

[myfaces-tobago] 01/02: TOBAGO-1843: Demo

Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 850a96f79dfcd667d438d0c52d7754513b8e0ce3
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Thu Apr 26 14:01:35 2018 +0200

    TOBAGO-1843: Demo
    
    cleanup
---
 .../tobago/example/{test => demo}/Attribute.java   |  13 +-
 .../src/main/webapp/WEB-INF/faces-config.xml       |   6 -
 .../content/40-test/9000-attribute/attribute.xhtml |  79 ++++++++++++
 .../40-test/9000-attribute/mode-valueIfSet.xhtml   | 109 ++++++++++++++++
 .../40-test/90000-attic/attribute/attribute.xhtml  |  81 ------------
 .../90000-attic/attribute/mode-valueIfSet.js       |  39 ------
 .../90000-attic/attribute/mode-valueIfSet.xhtml    | 107 ---------------
 .../attribute/popup-modal.selenium.html            | 143 ---------------------
 .../90000-attic/attribute/popup-modal.xhtml        |  40 ------
 9 files changed, 197 insertions(+), 420 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/Attribute.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Attribute.java
similarity index 81%
rename from tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/Attribute.java
rename to tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Attribute.java
index d63c997..f6ae0bc 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/test/Attribute.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Attribute.java
@@ -17,21 +17,26 @@
  * under the License.
  */
 
-package org.apache.myfaces.tobago.example.test;
+package org.apache.myfaces.tobago.example.demo;
 
+import javax.enterprise.context.SessionScoped;
+import javax.inject.Named;
 import java.io.Serializable;
 
+@Named
+@SessionScoped
 public class Attribute implements Serializable {
 
   private int counter;
   private boolean condition;
 
-  public void resetCounter() {
-    counter = 0;
+  public String update() {
+    return "/content/40-test/9000-attribute/attribute.xhtml?faces-redirect=true";
   }
 
-  public void reload() {
+  public String reload() {
     counter++;
+    return null;
   }
 
   public int getCounter() {
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml b/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
index e9c2a94..b8788d3 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
@@ -155,12 +155,6 @@
   </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>
-
-  <managed-bean>
     <managed-bean-name>popupModalAttribute</managed-bean-name>
     <managed-bean-class>org.apache.myfaces.tobago.example.test.PopupModalAttribute</managed-bean-class>
     <managed-bean-scope>none</managed-bean-scope>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/9000-attribute/attribute.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/9000-attribute/attribute.xhtml
new file mode 100644
index 0000000..7af41bd
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/9000-attribute/attribute.xhtml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+
+<!-- XXX This is an old page. Content might not be up to date. Needs to be refactored, or just deleted. -->
+<f:view
+    xmlns:tc="http://myfaces.apache.org/tobago/component"
+    xmlns:ui="http://java.sun.com/jsf/facelets"
+    xmlns:f="http://java.sun.com/jsf/core"
+    xmlns:c="http://java.sun.com/jsp/jstl/core">
+
+  <tc:page>
+    <tc:gridLayout columns="250px 1fr">
+
+      <tc:label value="condition"/>
+      <tc:panel>
+        <f:facet name="layout">
+          <tc:gridLayout columns="1fr 1fr"/>
+        </f:facet>
+        <tc:selectBooleanCheckbox value="#{attribute.condition}"/>
+        <tc:button label="update" action="#{attribute.update}"/>
+      </tc:panel>
+
+      <tc:label value="simple output"/>
+      <tc:in readonly="true">
+        <tc:attribute name="value" value="Some Value from the tc:attribute"/>
+      </tc:in>
+
+      <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 outcome 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="outcome" value="/content/10-intro/intro.xhtml"/>
+        </c:if>
+      </tc:button>
+
+    </tc:gridLayout>
+  </tc:page>
+</f:view>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/9000-attribute/mode-valueIfSet.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/9000-attribute/mode-valueIfSet.xhtml
new file mode 100644
index 0000000..8b5ed86
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/9000-attribute/mode-valueIfSet.xhtml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+
+<!-- XXX This is an old page. Content might not be up to date. Needs to be refactored, or just deleted. -->
+<f:view
+    xmlns:tc="http://myfaces.apache.org/tobago/component"
+    xmlns:ui="http://java.sun.com/jsf/facelets"
+    xmlns:f="http://java.sun.com/jsf/core"
+    xmlns:c="http://java.sun.com/jsp/jstl/core">
+
+  <tc:page id="page">
+
+    <tc:section label="Test of the &lt;tc:attribute mode='valueIfSet'>">
+
+      <tc:box label="Set value via &lt;tc:attribute>">
+
+        <p>
+          The lable after the input field displays the expected string.
+        </p>
+
+        <tc:segmentLayout medium="4seg 4seg 4seg">
+
+          <tc:label value="direct literal:"/>
+          <tc:in id="direct" label="literal value" labelLayout="segmentRight">
+            <tc:attribute name="value" value="literal value" mode="valueIfSet"/>
+          </tc:in>
+
+          <c:set var="value1" value="c:set variable"/>
+          <tc:label value="via c:set:"/>
+          <tc:in id="v1" label="c:set variable" labelLayout="segmentRight">
+            <tc:attribute name="value" value="#{value1}" mode="valueIfSet"/>
+          </tc:in>
+
+          <c:set var="value2" value="#{value1}"/>
+          <tc:label value="via c:set in c:set:"/>
+          <tc:in id="v2" label="c:set variable" labelLayout="segmentRight">
+            <tc:attribute name="value" value="#{value2}" mode="valueIfSet"/>
+          </tc:in>
+
+          <c:set var="value3" value="#{value1} with other text"/>
+          <tc:label value="via c:set in c:set with other text:"/>
+          <tc:in id="v3" label="c:set variable with other text" labelLayout="segmentRight">
+            <tc:attribute name="value" value="#{value3}" mode="valueIfSet"/>
+          </tc:in>
+
+          <c:set var="value4" value="#{attribute.value}"/>
+          <tc:label value="java session variable"/>
+          <tc:in id="v4" label="value from model" labelLayout="segmentRight">
+            <tc:attribute name="value" value="#{value4}" mode="valueIfSet"/>
+          </tc:in>
+
+          <tc:label value="undefined variable (empty)"/>
+          <tc:in id="vu" label="" labelLayout="segmentRight">
+            <tc:attribute name="value" value="#{value_undefined}" mode="valueIfSet"/>
+          </tc:in>
+        </tc:segmentLayout>
+      </tc:box>
+
+      <tc:box label="Set id via &lt;tc:attribute>" id="id-box">
+
+        <p>
+          The lable after the input field displays the expected id attribute.
+        </p>
+
+        <tc:segmentLayout medium="4seg 4seg 4seg">
+
+        <tc:label value="id"/>
+        <tc:in label="page:my_number_1::field" labelLayout="segmentRight">
+          <tc:attribute name="id" value="my_number_1" mode="valueIfSet"/>
+        </tc:in>
+
+        <tc:label value="id (not implemented)"/>
+        <tc:in label="'autogenerated'" labelLayout="segmentRight">
+          <tc:attribute name="id" value="#{'my_number_2'}" mode="valueIfSet"/>
+        </tc:in>
+
+        <c:set var="id3" value="my_number_3"/>
+        <tc:label value="id"/>
+        <tc:in label="page:my_number_3::field" labelLayout="segmentRight">
+          <tc:attribute name="id" value="#{id3}" mode="valueIfSet"/>
+        </tc:in>
+
+        <tc:label value="id (undefined)"/>
+        <tc:in label="'autogenerated'" labelLayout="segmentRight">
+          <tc:attribute name="id" value="#{id_undefined}" mode="valueIfSet"/>
+        </tc:in>
+
+        </tc:segmentLayout>
+      </tc:box>
+
+    </tc:section>
+
+  </tc:page>
+</f:view>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/attribute.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/attribute.xhtml
deleted file mode 100644
index b25ee3f..0000000
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/attribute.xhtml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-
-<!-- XXX This is an old page. Content might not be up to date. Needs to be refactored, or just deleted. -->
-<f:view
-    xmlns:tc="http://myfaces.apache.org/tobago/component"
-    xmlns:ui="http://java.sun.com/jsf/facelets"
-    xmlns:f="http://java.sun.com/jsf/core"
-    xmlns:c="http://java.sun.com/jsp/jstl/core">
-
-  <tc:page>
-    <f:facet name="layout">
-      <tc:gridLayout rows="auto auto auto auto auto auto 1fr" columns="250px 1fr"/>
-    </f:facet>
-    <!-- <tc:gridLayoutConstraint width="600px" height="300px"/> -->
-
-    <tc:label value="condition"/>
-    <tc:panel>
-      <f:facet name="layout">
-        <tc:gridLayout columns="1fr 1fr"/>
-      </f:facet>
-      <tc:selectBooleanCheckbox value="#{attribute.condition}"/>
-      <tc:button label="update"/>
-    </tc:panel>
-
-    <tc:label value="simple output"/>
-    <tc:in readonly="true">
-      <tc:attribute name="value" value="Some Value from the tc:attribute"/>
-    </tc:in>
-
-    <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>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/mode-valueIfSet.js b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/mode-valueIfSet.js
deleted file mode 100644
index 28b5991..0000000
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/mode-valueIfSet.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.
- */
-
-jQuery(document).ready(function () {
-
-  // only to display
-  jQuery("#page\\:id-box").find("input").each(function () {
-    jQuery(this).val(jQuery(this).attr('id'));
-  });
-
-  // assertions
-  TobagoAssert.assertValue("page:direct", "direct literal");
-  TobagoAssert.assertValue("page:v1", "from var");
-  TobagoAssert.assertValue("page:v2", "from var");
-  TobagoAssert.assertValue("page:v3", "from var ++");
-  TobagoAssert.assertValue("page:v4", "value from model");
-  TobagoAssert.assertValue("page:vu", "");
-
-  var i1 = jQuery(Tobago.Utils.escapeClientId("page:id-box")).find("input:eq(0)");
-  TobagoAssert.assertAttribute(i1, "id", "page:my_number_1");
-//        TobagoAssert.assertAttribute(..., "id", "");
-  var i3 = jQuery(Tobago.Utils.escapeClientId("page:id-box")).find("input:eq(2)");
-  TobagoAssert.assertAttribute(i3, "id", "page:my_number_3");
-//        TobagoAssert.assertAttribute(..., "id", "");
-});
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/mode-valueIfSet.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/mode-valueIfSet.xhtml
deleted file mode 100644
index d3ffa9c..0000000
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/mode-valueIfSet.xhtml
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-
-<!-- XXX This is an old page. Content might not be up to date. Needs to be refactored, or just deleted. -->
-<f:view
-    xmlns:tc="http://myfaces.apache.org/tobago/component"
-    xmlns:ui="http://java.sun.com/jsf/facelets"
-    xmlns:f="http://java.sun.com/jsf/core"
-    xmlns:c="http://java.sun.com/jsp/jstl/core">
-
-  <tc:page id="page">
-    <f:facet name="layout">
-      <tc:gridLayout rows="auto"/>
-    </f:facet>
-    <!-- <tc:gridLayoutConstraint width="600px" height="600px"/> -->
-
-    <tc:label value="demo of the valueIfSet mode of tc:attribute (facelets only)"/>
-
-    <tc:box label="value">
-      <f:facet name="layout">
-        <tc:gridLayout rows="auto auto auto auto auto auto 1fr" columns="250px 1fr"/>
-      </f:facet>
-
-      <tc:label value="value"/>
-      <tc:in id="direct">
-        <tc:attribute name="value" value="direct literal" mode="valueIfSet"/>
-      </tc:in>
-
-      <c:set var="value1" value="from var"/>
-      <tc:label value="value"/>
-      <tc:in id="v1">
-        <tc:attribute name="value" value="#{value1}" mode="valueIfSet"/>
-      </tc:in>
-
-      <c:set var="value2" value="#{value1}"/>
-      <tc:label value="value"/>
-      <tc:in id="v2">
-        <tc:attribute name="value" value="#{value2}" mode="valueIfSet"/>
-      </tc:in>
-
-      <c:set var="value3" value="#{value1} ++"/>
-      <tc:label value="value"/>
-      <tc:in id="v3">
-        <tc:attribute name="value" value="#{value3}" mode="valueIfSet"/>
-      </tc:in>
-
-      <c:set var="value4" value="#{attribute.value}"/>
-      <tc:label value="value"/>
-      <tc:in id="v4">
-        <tc:attribute name="value" value="#{value4}" mode="valueIfSet"/>
-      </tc:in>
-
-      <tc:label value="value (undefined)"/>
-      <tc:in id="vu">
-        <tc:attribute name="value" value="#{value_undefined}" mode="valueIfSet"/>
-      </tc:in>
-
-    </tc:box>
-
-    <tc:box label="id" id="id-box">
-      <f:facet name="layout">
-        <tc:gridLayout rows="auto auto auto auto auto auto 1fr" columns="250px 1fr"/>
-      </f:facet>
-
-      <tc:label value="id"/>
-      <tc:in>
-        <tc:attribute name="id" value="my_number_1" mode="valueIfSet"/>
-      </tc:in>
-
-      <tc:label value="id (not implemented)"/>
-      <tc:in>
-        <tc:attribute name="id" value="#{'my_number_2'}" mode="valueIfSet"/>
-      </tc:in>
-
-      <c:set var="id3" value="my_number_3"/>
-      <tc:label value="id"/>
-      <tc:in>
-        <tc:attribute name="id" value="#{id3}" mode="valueIfSet"/>
-      </tc:in>
-
-      <tc:label value="id (undefined)"/>
-      <tc:in>
-        <tc:attribute name="id" value="#{id_undefined}" mode="valueIfSet"/>
-      </tc:in>
-
-    </tc:box>
-
-    <tc:script file="script/tobago-assert.js"/>
-    <tc:script file="test/attribute/mode-valueIfSet.js"/>
-
-  </tc:page>
-</f:view>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/popup-modal.selenium.html b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/popup-modal.selenium.html
deleted file mode 100644
index 9a961c2..0000000
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/popup-modal.selenium.html
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<!--
- * 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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="http://localhost:8080/" />
-<title>New Test</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">New Test</td></tr>
-</thead><tbody>
-<tr>
-	<td>open</td>
-	<td>/faces/test/attribute/popup-modal.xhtml</td>
-	<td></td>
-</tr>
-<tr>
-	<td>clickAndWait</td>
-	<td>//button[1]</td>
-	<td></td>
-</tr>
-<tr>
-	<td>waitForElementPresent</td>
-	<td>class=tobago-popup tobago-popup-markup-modal</td>
-	<td></td>
-</tr>
-<tr>
-	<td>click</td>
-	<td>//div[2]/button</td>
-	<td></td>
-</tr>
-<tr>
-	<td>clickAndWait</td>
-	<td>//button[2]</td>
-	<td></td>
-</tr>
-<tr>
-	<td>waitForElementPresent</td>
-	<td>class=tobago-popup tobago-popup-markup-modal</td>
-	<td></td>
-</tr>
-<tr>
-	<td>click</td>
-	<td>//div[2]/button</td>
-	<td></td>
-</tr>
-<tr>
-	<td>clickAndWait</td>
-	<td>//button[3]</td>
-	<td></td>
-</tr>
-<tr>
-	<td>waitForElementPresent</td>
-	<td>class=tobago-popup</td>
-	<td></td>
-</tr>
-<tr>
-	<td>click</td>
-	<td>//div[2]/button</td>
-	<td></td>
-</tr>
-<tr>
-	<td>clickAndWait</td>
-	<td>//button[4]</td>
-	<td></td>
-</tr>
-<tr>
-	<td>waitForElementPresent</td>
-	<td>class=tobago-popup tobago-popup-markup-modal</td>
-	<td></td>
-</tr>
-<tr>
-	<td>click</td>
-	<td>//div[2]/button</td>
-	<td></td>
-</tr>
-<tr>
-	<td>clickAndWait</td>
-	<td>//button[5]</td>
-	<td></td>
-</tr>
-<tr>
-	<td>waitForElementPresent</td>
-	<td>class=tobago-popup</td>
-	<td></td>
-</tr>
-<tr>
-	<td>click</td>
-	<td>//div[2]/button</td>
-	<td></td>
-</tr>
-<tr>
-	<td>clickAndWait</td>
-	<td>//button[6]</td>
-	<td></td>
-</tr>
-<tr>
-	<td>waitForElementPresent</td>
-	<td>class=tobago-popup tobago-popup-markup-modal</td>
-	<td></td>
-</tr>
-<tr>
-	<td>click</td>
-	<td>//div[2]/button</td>
-	<td></td>
-</tr>
-<tr>
-	<td>clickAndWait</td>
-	<td>//button[7]</td>
-	<td></td>
-</tr>
-<tr>
-	<td>waitForElementPresent</td>
-	<td>class=tobago-popup</td>
-	<td></td>
-</tr>
-<tr>
-	<td>click</td>
-	<td>//div[2]/button</td>
-	<td></td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/popup-modal.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/popup-modal.xhtml
deleted file mode 100644
index a18c8ea..0000000
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/90000-attic/attribute/popup-modal.xhtml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-
-<!-- XXX This is an old page. Content might not be up to date. Needs to be refactored, or just deleted. -->
-<f:view
-    xmlns:tc="http://myfaces.apache.org/tobago/component"
-    xmlns:test="http://myfaces.apache.org/tobago/example/test"
-    xmlns:f="http://java.sun.com/jsf/core">
-
-  <tc:page>
-
-    <f:facet name="layout">
-      <tc:gridLayout columns="300px" rows="auto auto auto auto auto auto auto"/>
-    </f:facet>
-
-    <test:popup id="d" label="modal: default"/>
-    <test:popup id="t" label="modal: true" modal="true"/>
-    <test:popup id="f" label="modal: false" modal="false"/>
-    <test:popup id="te" label="modal: \#{true}" modal="#{true}"/>
-    <test:popup id="fe" label="modal: \#{false}" modal="#{false}"/>
-    <test:popup id="tb" label="modal: \#{popupModalAttribute.alwaysTrue}" modal="#{popupModalAttribute.alwaysTrue}"/>
-    <test:popup id="fb" label="modal: \#{popupModalAttribute.alwaysFalse}" modal="#{popupModalAttribute.alwaysFalse}"/>
-
-  </tc:page>
-</f:view>

-- 
To stop receiving notification emails like this one, please contact
lofwyr@apache.org.

[myfaces-tobago] 02/02: TOBAGO-1843: Demo

Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 898ed97563b2d20971ec52c53cac76be3c7c0e97
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Fri Apr 27 14:30:06 2018 +0200

    TOBAGO-1843: Demo
    
    Configure "rendered" and "fixed" over checkboxes
---
 .../example/demo/HeaderFooterController.java       | 47 ++++++++++++++++++++++
 .../50-header+footer/x-header-footer-example.xhtml | 42 +++++++++++++------
 2 files changed, 76 insertions(+), 13 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/HeaderFooterController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/HeaderFooterController.java
new file mode 100644
index 0000000..86b5b5d
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/HeaderFooterController.java
@@ -0,0 +1,47 @@
+package org.apache.myfaces.tobago.example.demo;
+
+import javax.enterprise.context.SessionScoped;
+import javax.inject.Named;
+import java.io.Serializable;
+
+@Named
+@SessionScoped
+public class HeaderFooterController implements Serializable {
+
+  private boolean renderHeader = true;
+  private boolean fixHeader = true;
+  private boolean renderFooter = true;
+  private boolean fixFooter = true;
+
+  public boolean isRenderHeader() {
+    return renderHeader;
+  }
+
+  public void setRenderHeader(boolean renderHeader) {
+    this.renderHeader = renderHeader;
+  }
+
+  public boolean isFixHeader() {
+    return fixHeader;
+  }
+
+  public void setFixHeader(boolean fixHeader) {
+    this.fixHeader = fixHeader;
+  }
+
+  public boolean isRenderFooter() {
+    return renderFooter;
+  }
+
+  public void setRenderFooter(boolean renderFooter) {
+    this.renderFooter = renderFooter;
+  }
+
+  public boolean isFixFooter() {
+    return fixFooter;
+  }
+
+  public void setFixFooter(boolean fixFooter) {
+    this.fixFooter = fixFooter;
+  }
+}
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header+footer/x-header-footer-example.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header+footer/x-header-footer-example.xhtml
index 2b21176..c44b5cb 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header+footer/x-header-footer-example.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/50-header+footer/x-header-footer-example.xhtml
@@ -20,24 +20,40 @@
 <ui:composition template="/plain.xhtml"
                 xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:tc="http://myfaces.apache.org/tobago/component"
-                xmlns:ui="http://java.sun.com/jsf/facelets">
-  <tc:header fixed="true">
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core">
+  <tc:header fixed="#{headerFooterController.fixHeader}" rendered="#{headerFooterController.renderHeader}">
     <tc:style customClass="bg-warning"/>
     <p>This is the header.</p>
   </tc:header>
   <tc:box label="Content Box">
-    <p>Content between header and footer.</p>
-    <p>Content between header and footer.</p>
-    <p>Content between header and footer.</p>
-    <p>Content between header and footer.</p>
-    <p>Content between header and footer.</p>
-    <p>Content between header and footer.</p>
-    <p>Content between header and footer.</p>
-    <p>Content between header and footer.</p>
-    <p>Content between header and footer.</p>
-    <p>Content between header and footer.</p>
+    <tc:segmentLayout medium="3seg 3seg 3seg 3seg" small="6seg 6seg">
+      <tc:selectBooleanCheckbox value="#{headerFooterController.renderHeader}" label="Render header">
+        <tc:event/>
+      </tc:selectBooleanCheckbox>
+      <tc:selectBooleanCheckbox value="#{headerFooterController.fixHeader}" label="Fix header">
+        <tc:event/>
+      </tc:selectBooleanCheckbox>
+      <tc:selectBooleanCheckbox value="#{headerFooterController.renderFooter}" label="Render footer">
+        <tc:event/>
+      </tc:selectBooleanCheckbox>
+      <tc:selectBooleanCheckbox value="#{headerFooterController.fixFooter}" label="Fix footer">
+        <tc:event/>
+      </tc:selectBooleanCheckbox>
+    </tc:segmentLayout>
+
+    <p>Content between header and footer #1.</p>
+    <p>Content between header and footer #2.</p>
+    <p>Content between header and footer #3.</p>
+    <p>Content between header and footer #4.</p>
+    <p>Content between header and footer #5.</p>
+    <p>Content between header and footer #6.</p>
+    <p>Content between header and footer #7.</p>
+    <p>Content between header and footer #8.</p>
+    <p>Content between header and footer #9.</p>
+    <p>Content between header and footer #10.</p>
   </tc:box>
-  <tc:footer fixed="true">
+  <tc:footer fixed="#{headerFooterController.fixFooter}" rendered="#{headerFooterController.renderFooter}">
     <tc:style customClass="bg-info"/>
     <p>This is the footer.</p>
   </tc:footer>

-- 
To stop receiving notification emails like this one, please contact
lofwyr@apache.org.