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 2016/03/17 11:29:40 UTC
svn commit: r1735394 - in
/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main:
java/org/apache/myfaces/tobago/example/demo/ webapp/content/10-intro/
webapp/content/20-component/010-input/ webapp/content/20-component/010-in...
Author: lofwyr
Date: Thu Mar 17 10:29:40 2016
New Revision: 1735394
URL: http://svn.apache.org/viewvc?rev=1735394&view=rev
Log:
TOBAGO-1544: Revise Demo Application for Tobago 3.0
Added:
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InController.java
- copied, changed from r1735195, myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/In.java
Removed:
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/In.java
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/basic.xhtml
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/intro.xhtml
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/in.xhtml
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/input.xhtml
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml
myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview_de.properties.xml
Copied: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InController.java (from r1735195, myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/In.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InController.java?p2=myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InController.java&p1=myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/In.java&r1=1735195&r2=1735394&rev=1735394&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/In.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/InController.java Thu Mar 17 10:29:40 2016
@@ -28,9 +28,9 @@ import javax.inject.Named;
@RequestScoped
@Named
-public class In {
+public class InController {
- private static final Logger LOG = LoggerFactory.getLogger(In.class);
+ private static final Logger LOG = LoggerFactory.getLogger(InController.class);
private String changeValue;
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/intro.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/intro.xhtml?rev=1735394&r1=1735393&r2=1735394&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/intro.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/intro.xhtml Thu Mar 17 10:29:40 2016
@@ -19,7 +19,8 @@
<ui:composition template="/main.xhtml"
xmlns:tc="http://myfaces.apache.org/tobago/component"
- xmlns:ui="http://java.sun.com/jsf/facelets">
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core">
<ui:param name="title" value="#{overviewBundle.intro}"/>
@@ -27,4 +28,125 @@
<tc:out value="#{overviewBundle.notTranslated}" id="nt" />
+ <tc:section label="Some short examples (Todo: revise)">
+
+ <f:facet name="layout">
+ <tc:gridLayout rows="auto;2*;3*;auto;2*;2*;auto;2*;2*"/>
+ <!--<tc:gridLayout border="0" rows="*;*;*;*;*;*;*;*;*;*"/>-->
+ </f:facet>
+
+ <!-- row -->
+ <tc:separator label="#{overviewBundle.basic_sampleInputTitle}"/>
+
+ <!-- row -->
+ <tc:out escape="false" value="#{overviewBundle.basic_text_input}" id="basic_text_input"/>
+
+ <!-- row -->
+ <tc:panel>
+ <f:facet name="layout">
+ <tc:gridLayout columns="*;*"/>
+ </f:facet>
+
+ <tc:panel>
+ <f:facet name="layout">
+ <tc:gridLayout rows="auto;auto;auto;auto"/>
+ </f:facet>
+ <tc:in value="#{overviewController.basicInput}" required="true" tabIndex="1" id="basic_input"
+ label="#{overviewBundle.basic_textboxLabel}" tip="#{overviewBundle.basic_textboxTip}"/>
+ <tc:in value="#{overviewController.suggestInput}" tabIndex="3" id="suggest_input"
+ label="#{overviewBundle.basic_suggestLabel}" tip="#{overviewBundle.basic_suggestTip}"
+ placeholder="Country (Language)">
+ <tc:suggest suggestMethod="#{overviewController.getInputSuggestItems}"
+ id="suggest" delay="300" minimumCharacters="1" maximumItems="10"/>
+ </tc:in>
+ <tc:date value="#{overviewController.basicDate}" tabIndex="4" id="basic_date"
+ label="#{overviewBundle.basic_dateLabel}" required="true">
+ <f:convertDateTime pattern="dd/MM/yyyy"/>
+ <tc:validateSubmittedValueLength maximum="10"/>
+ </tc:date>
+ <tc:date label="#{overviewBundle.basic_timeLabel}" tabIndex="5" id="basic_time"
+ value="#{overviewController.basicTime}">
+ <f:convertDateTime pattern="HH:mm" timeZone="CET"/>
+ </tc:date>
+ <tc:in value="#{overviewController.placeholder}" tabIndex="6" id="basic_placeholder"
+ label="Placeholder" placeholder="Search..."/>
+ </tc:panel>
+
+ <tc:textarea value="#{overviewController.basicArea}" tabIndex="2" tip="max length = 1000"
+ label="#{overviewBundle.basic_textareaLabel}">
+ <f:validateLength maximum="1000"/>
+ </tc:textarea>
+ </tc:panel>
+
+ <!-- row -->
+ <tc:separator label="#{overviewBundle.basic_sampleSelectTitle}"/>
+
+ <!-- row -->
+ <tc:out escape="false" value="#{overviewBundle.basic_text_select}"/>
+
+ <!-- row -->
+ <tc:panel>
+ <f:facet name="layout">
+ <tc:gridLayout columns="*;*" border="0"/>
+ </f:facet>
+ <tc:selectOneRadio label="Select One" value="#{overviewController.radioValue}" id="rg0">
+ <tc:selectItems value="#{overviewController.currencyItems}" id="items0"
+ var="currency" itemValue="#{currency.currencyCode}" itemLabel="#{currency.displayName}"
+ itemImage="data/#{currency.currencyCode}-14.png"/>
+ <!-- images come from tobago-example-data -->
+ <!--
+ <f:facet name="click">
+ <tc:command/>
+ </f:facet>
+ -->
+ </tc:selectOneRadio>
+
+ <tc:panel>
+ <f:facet name="layout">
+ <tc:gridLayout rows="auto;auto"/>
+ </f:facet>
+ <tc:selectManyCheckbox label="Select Many" value="#{overviewController.multiValue}"
+ id="cbg0" renderRange="1-2" converter="salutationId">
+ <f:selectItems value="#{overviewController.items}" id="itemsg0"/>
+ </tc:selectManyCheckbox>
+ <tc:selectOneChoice label="Select One Choice" value="#{overviewController.singleValue}"
+ converter="salutationId">
+ <f:selectItems value="#{overviewController.items}"/>
+ </tc:selectOneChoice>
+ </tc:panel>
+ </tc:panel>
+
+ <!-- row -->
+ <tc:separator label="#{overviewBundle.basic_sampleLinkTitle}"/>
+
+ <!-- row -->
+ <tc:out escape="false" value="#{overviewBundle.basic_text_action}"/>
+
+ <!-- row -->
+ <tc:flowLayout>
+ <tc:link id="link"
+ actionListener="#{overviewController.click}"
+ label="#{overviewBundle.basic_linkAction}"/>
+ <tc:link id="image"
+ actionListener="#{overviewController.click}"
+ image="image/image_button.png"/>
+ <tc:button id="button"
+ actionListener="#{overviewController.click}"
+ label="#{overviewBundle.basic_buttonAction}"/>
+ </tc:flowLayout>
+
+ <!-- row -->
+ <tc:in value="#{overviewController.lastAction}" readonly="true"
+ label="#{overviewBundle.basic_lastActionLabel}">
+ <tc:gridLayoutConstraint columnSpan="5"/>
+ </tc:in>
+
+ <!-- todo: deprecated -->
+ <tc:script>
+ new Tobago.AcceleratorKey(function() {Tobago.clickOnElement('page:image');}, 'O', "ctrl");
+ new Tobago.AcceleratorKey(function() {Tobago.clickOnElement('page:button');}, 'B', "ctrl");
+ </tc:script>
+
+ </tc:section>
+
</ui:composition>
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/in.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/in.xhtml?rev=1735394&r1=1735393&r2=1735394&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/in.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/10-in/in.xhtml Thu Mar 17 10:29:40 2016
@@ -19,10 +19,12 @@
<ui:composition template="/main.xhtml"
xmlns:tc="http://myfaces.apache.org/tobago/component"
- xmlns:ui="http://java.sun.com/jsf/facelets">
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core">
<ui:param name="title" value="#{overviewBundle.in} <tc:in>"/>
<p>The <code class="language-markup"><tc:in/></code> tag create a classic inputfield.</p>
<p>A documentation of all possible attributes can be found here (https://myfaces.apache.org/tobago/doc/2.0.9/tld/tc/in.html). TODO: link to tobago3</p>
+
<tc:section label="Basics">
<p>In the most cases, a label should be placed in front of every inputfield. For this use the attribute
<code>label</code>.</p>
@@ -32,11 +34,13 @@
<tc:in id="i3" label="Disabled" disabled="true" value="Some Text"/>
<tc:in id="i4" value="Input without a label"/>
</tc:section>
+
<tc:section label="Focus">
<p>The following inputfield should be selected after reloading the page. Use the <code>focus</code> attribute.</p>
<pre><code class="language-markup"><tc:in label="Input (focus)" focus="true" value="Some Text"/></code></pre>
<tc:in id="i5" label="Input (focus)" focus="true" value="Some Text"/>
</tc:section>
+
<tc:section label="Password">
<p>To create an inputfield for passwords, set the
<code>password</code> attribute to 'true'. It will hide the text as shown in the following example.</p>
@@ -44,10 +48,25 @@
class="language-markup"><tc:in label="Password" password="true" value="password"/></code></pre>
<tc:in id="i6" label="Password" password="true" value="password"/>
</tc:section>
+
<tc:section label="Placeholder">
<p>Another way to tell the user the meaning of a field is the <code>placeholder</code> attribute.</p>
<p>The text of the placeholder will only be shown, if the value is an empty string.</p>
<pre><code class="language-markup"><tc:in label="Placeholder" placeholder="Grey Text"/></code></pre>
<tc:in id="i7" label="Placeholder" placeholder="Short description of the field." value=""/>
</tc:section>
+
+ <tc:section label="Ajax">
+ <p>
+ The outputfield in this example, display the given value on the server.
+ With <code class="language-markup"><f:ajax render="outputfield"/></code>, the outputfield will be rerendered,
+ after the value has been changed, because its id is <code>outputfield</code> and the default event for
+ <code><tc:in></code> is <code>change</code>.
+ </p>
+ <tc:in id="i8" label="On Change" value="#{inController.changeValue}">
+ <f:ajax render="outputfield"/>
+ </tc:in>
+ <tc:out id="outputfield" label="On Server" value="#{inController.changeValue}"/>
+ </tc:section>
+
</ui:composition>
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/input.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/input.xhtml?rev=1735394&r1=1735393&r2=1735394&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/input.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/input.xhtml Thu Mar 17 10:29:40 2016
@@ -43,11 +43,11 @@
<tc:panel id="panel">
- <tc:in id="i6" value="#{in.changeValue}" label="on change">
- <f:ajax render="panel" listener="#{in.update}"/>
+ <tc:in id="i6" value="#{inController.changeValue}" label="on change">
+ <f:ajax render="panel" listener="#{inController.update}"/>
</tc:in>
- <tc:out id="o" value="#{in.changeValue}" label="value on server"/>
+ <tc:out id="o" value="#{inController.changeValue}" label="value on server"/>
</tc:panel>
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml?rev=1735394&r1=1735393&r2=1735394&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml Thu Mar 17 10:29:40 2016
@@ -51,8 +51,6 @@
<entry key="select">Select</entry>
<entry key="selectBooleanCheckbox">Boolean Checkbox</entry>
-
- <entry key="basic">Basic Controls</entry>
<entry key="sheet">Sheet Control</entry>
<entry key="tree">Tree Control</entry>
<entry key="tree-editor">Editor</entry>
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview_de.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview_de.properties.xml?rev=1735394&r1=1735393&r2=1735394&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview_de.properties.xml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview_de.properties.xml Thu Mar 17 10:29:40 2016
@@ -33,7 +33,6 @@
<!-- navigate -->
<entry key="overview">Ãbersicht</entry>
<entry key="intro">Einführung</entry>
- <entry key="basic">Basis</entry>
<entry key="sheet">Tabellen</entry>
<entry key="tree">Bäume</entry>
<entry key="tab">Reiter / Tab</entry>