You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2019/12/02 09:29:54 UTC

[myfaces-tobago] 17/19: Tobago-1999: working on demo

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

weber pushed a commit to branch TOBAGO-1999_Select2
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit fa73314c7bfc7e83c66086155389a6d35a6d0c39
Author: Volker Weber <v....@inexso.de>
AuthorDate: Fri Oct 4 09:19:35 2019 +0200

    Tobago-1999: working on demo
---
 .../tobago/example/demo/Select2Controller.java       | 20 ++++++++++++++++++++
 .../content/25-select/00-select2/select2.xhtml       |  4 ++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Select2Controller.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Select2Controller.java
new file mode 100644
index 0000000..db6e987
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Select2Controller.java
@@ -0,0 +1,20 @@
+package org.apache.myfaces.tobago.example.demo;
+
+import javax.enterprise.context.SessionScoped;
+import javax.inject.Named;
+import java.io.Serializable;
+
+@SessionScoped
+@Named
+public class Select2Controller implements Serializable {
+
+  private String one2;
+
+  public String getOne2() {
+    return one2;
+  }
+
+  public void setOne2(String one2) {
+    this.one2 = one2;
+  }
+}
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/25-select/00-select2/select2.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/25-select/00-select2/select2.xhtml
index 47746cb..d5c36cd 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/25-select/00-select2/select2.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/25-select/00-select2/select2.xhtml
@@ -67,7 +67,7 @@
         <tc:selectOneChoice id="one_2"
                             minimumResultsForSearch="10"
                             placeholder="Please select message type"
-                            value="">
+                            value="#{select2Controller.one2}">
 
           <tc:selectItem itemLabel="Letter" itemValue="letter"/>
           <tc:selectItem itemLabel="Phone" itemValue="phone"/>
@@ -183,7 +183,7 @@
         <tc:gridLayout columns="*;auto"/>
       </f:facet>
       <tc:panel/>
-      <tc:button action="/content/25-select/select.xhtml" label="Submit"/>
+      <tc:button label="Submit"/>
     </tc:panel>
 
   </tc:panel>