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 2022/11/16 14:11:20 UTC

[myfaces-tobago] branch tobago-5.x updated: Tobago 5.x demo textarea (#3417)

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

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


The following commit(s) were added to refs/heads/tobago-5.x by this push:
     new e77e4aa286 Tobago 5.x demo textarea (#3417)
e77e4aa286 is described below

commit e77e4aa2864d84d5b375ccfe9f8bcec73e48dc13
Author: Udo Schnurpfeil <gi...@schnurpfeil.de>
AuthorDate: Wed Nov 16 15:11:15 2022 +0100

    Tobago 5.x demo textarea (#3417)
    
    * next release version 4.6
    
    * demo(textarea): use model
---
 .../myfaces/tobago/example/demo/Release.java       |  3 +-
 .../tobago/example/demo/TextareaController.java    | 41 ++++++++++++++++++++--
 .../content/010-input/30-textarea/Textarea.xhtml   |  8 ++---
 3 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Release.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Release.java
index 2405182bb5..05946d152a 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Release.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Release.java
@@ -145,7 +145,8 @@ public enum Release {
   v4_5_2("12349344"),
   v4_5_3("12349662"),
   v4_5_4("12350057"),
-  v4_5_5("12350236", true),
+  v4_5_5("12350236"),
+  v4_6_0("12352084", true),
 
   v5_0_0_alpha_1("12350237"),
   v5_0_0_alpha_2("12350431"),
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TextareaController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TextareaController.java
index 3df98c7f36..a70eeeab16 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TextareaController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TextareaController.java
@@ -22,17 +22,22 @@ package org.apache.myfaces.tobago.example.demo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.enterprise.context.RequestScoped;
+import javax.enterprise.context.SessionScoped;
 import javax.inject.Named;
 import java.io.Serializable;
 import java.lang.invoke.MethodHandles;
 
-@RequestScoped
+@SessionScoped
 @Named
 public class TextareaController implements Serializable {
 
   private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
+  private String text1 = "Some text with more than one row.\nThis is the 2nd row.";
+  private String text2 = "Some text (read-only).";
+  private String text3 = "Some text (disabled).";
+  private String text4 = "Some text without a label at the control.";
+
   private String longText;
   private String ajaxValue;
 
@@ -59,6 +64,38 @@ public class TextareaController implements Serializable {
     return null;
   }
 
+  public String getText1() {
+    return text1;
+  }
+
+  public void setText1(String text1) {
+    this.text1 = text1;
+  }
+
+  public String getText2() {
+    return text2;
+  }
+
+  public void setText2(String text2) {
+    this.text2 = text2;
+  }
+
+  public String getText3() {
+    return text3;
+  }
+
+  public void setText3(String text3) {
+    this.text3 = text3;
+  }
+
+  public String getText4() {
+    return text4;
+  }
+
+  public void setText4(String text4) {
+    this.text4 = text4;
+  }
+
   public String getLongText() {
     return longText;
   }
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/010-input/30-textarea/Textarea.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/010-input/30-textarea/Textarea.xhtml
index cc6ed657fd..65551719ab 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/010-input/30-textarea/Textarea.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/010-input/30-textarea/Textarea.xhtml
@@ -33,13 +33,13 @@
                                       outcome="/content/010-input/10-in/In.xhtml"/> there is no placeholder attribute to describe the meaning of a textarea, when no label is set.</p>
     <demo-highlight language="markup">&lt;tc:textarea label="Text Area" value="Some text, some text, ..."/&gt;</demo-highlight>
     <tc:textarea id="t1" label="Text Area"
-                 value="Some text, some text, some text, some text, some text, some text, some text, some text, some text, some text, ..."/>
+                 value="#{textareaController.text1}"/>
     <tc:textarea id="t2" label="Read Only" readonly="true"
-                 value="Some text, some text, some text, some text, some text, some text, some text, some text, some text, some text, ..."/>
+                 value="#{textareaController.text2}"/>
     <tc:textarea id="t3" label="Disabled" disabled="true"
-                 value="Some text, some text, some text, some text, some text, some text, some text, some text, some text, some text, ..."/>
+                 value="#{textareaController.text3}"/>
     <tc:textarea id="t4"
-                 value="Text Area without a label, Text Area without a label, Text Area without a label, Text Area without a label, Text Area without a label, Text Area without a label, Text Area without a label, Text Area without a label, Text Area without a label, ..."/>
+                 value="#{textareaController.text4}"/>
   </tc:section>
   <tc:section label="Focus">
     <p>The following textarea should be selected after reloading this page. Use the <code>focus</code> attribute.</p>