You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2020/03/18 12:48:05 UTC

[myfaces-tobago] branch master updated: tc:out: improve input group example (#39)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 40d984f  tc:out: improve input group example (#39)
40d984f is described below

commit 40d984f9e5f2a7858739b4a4eefc8946db6391e1
Author: JasminKroeger <ja...@web.de>
AuthorDate: Wed Mar 18 13:47:56 2020 +0100

    tc:out: improve input group example (#39)
    
    tc:out: improve input group example
    
    The example shows, how to use twice labels in an input group. It is possible to have more than one label on one side of an input group. The multiple tc:out is located inside the f:facet and the f:facet is inside the tc:in.
    
    Issue: TOBAGO-1843
    
    Co-authored-by: Jasmin Kroeger <ja...@irian.eu>
---
 .../myfaces/tobago/example/demo/GroupController.java      | 12 ++++++++++++
 .../20-component/010-input/50-input-group/Group.xhtml     | 15 +++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/GroupController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/GroupController.java
index 6e5a67d..d0347fa 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/GroupController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/GroupController.java
@@ -43,6 +43,8 @@ public class GroupController implements Serializable {
   private double valueInEuro;
   private Currency currency;
   private static final Currency[] CURRENCIES;
+  private String firstName;
+  private String lastName;
 
   static {
     CURRENCIES = new Currency[]{
@@ -58,6 +60,8 @@ public class GroupController implements Serializable {
     sendTo = "";
     value = 1000.0;
     currency = Currency.getInstance("EUR");
+    firstName = "Bob";
+    lastName = "Marley";
     compute();
   }
 
@@ -156,4 +160,12 @@ public class GroupController implements Serializable {
   public Currency[] getCurrencies() {
     return CURRENCIES;
   }
+
+  public String getFirstName() { return firstName; }
+
+  public void setFirstName(String firstName) { this.firstName = firstName; }
+
+  public String getLastName() { return lastName; }
+
+  public void setLastName(String lastName) { this.lastName = lastName; }
 }
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/Group.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/Group.xhtml
index 040daf5..3ea232e 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/Group.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/50-input-group/Group.xhtml
@@ -49,6 +49,21 @@
         <f:facet name="after">.00 €</f:facet>
       </tc:in>
     </tc:section>
+    <tc:section label="Output">
+      <p>The following example show, how to add twice tc:out on one side in an input group</p>
+      <pre><code class="language-markup"> &lt;tc:in id="values">
+  &lt;f:facet name="before">
+    &lt;tc:out id="firstName" value="#{groupController.firstName}"/>
+    &lt;tc:out id="lastName" value="#{groupController.lastName}"/>
+  &lt;/f:facet>
+&lt;/tc:in></code></pre>
+      <tc:in id="values">
+        <f:facet name="before">
+          <tc:out id="firstName" value="#{groupController.firstName}"/>
+          <tc:out id="lastName" value="#{groupController.lastName}"/>
+        </f:facet>
+      </tc:in>
+    </tc:section>
   </tc:section>
 
   <tc:section label="Commands">