myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject [myfaces-tobago] 01/02: Demo: add binding
Date Wed, 18 Apr 2018 15:19:37 GMT
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 2a2ebe70239c9f471756a0697ccd893bfda78409
Author: Udo Schnurpfeil <lofwyr@apache.org>
AuthorDate: Wed Apr 18 14:36:18 2018 +0200

    Demo: add binding
---
 .../org/apache/myfaces/tobago/example/demo/InController.java   | 10 ++++++++++
 .../main/webapp/content/20-component/010-input/10-in/in.xhtml  |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InController.java
b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InController.java
index 25430c0..5c93943 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InController.java
@@ -34,6 +34,8 @@ public class InController {
 
   private String changeValue;
 
+  private String requiredValue;
+
   public void update(final AjaxBehaviorEvent event) {
     LOG.info("AjaxBehaviorEvent called. Current value: '{}'", changeValue);
   }
@@ -45,4 +47,12 @@ public class InController {
   public void setChangeValue(final String changeValue) {
     this.changeValue = changeValue;
   }
+
+  public String getRequiredValue() {
+    return requiredValue;
+  }
+
+  public void setRequiredValue(String requiredValue) {
+    this.requiredValue = requiredValue;
+  }
 }
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/in.xhtml
b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/in.xhtml
index 8575c3b..107196a 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/in.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/in.xhtml
@@ -46,7 +46,7 @@
       Such an inputfield must contain a value, otherwise a submit is not possible.
       Leave the field blank and press 'submit' to see the errormessage.</p>
     <pre><code class="language-markup">&lt;tc:in label="Input (required)"
required="true"/></code></pre>
-    <tc:in id="ireq" label="Input (required)" required="true"/>
+    <tc:in id="ireq" label="Input (required)" required="true" value="#{inController.requiredValue}"/>
     <tc:button label="Submit"/>
   </tc:section>
 

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

Mime
View raw message