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/18 15:19:37 UTC
[myfaces-tobago] 01/02: Demo: add binding
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 <lo...@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"><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.