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/11/28 18:40:50 UTC
svn commit: r1771792 - in
/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main:
java/org/apache/myfaces/tobago/example/demo/TabController.java
webapp/content/20-component/070-tab/01-ajax/tab-ajax.xhtml
Author: lofwyr
Date: Mon Nov 28 18:40:50 2016
New Revision: 1771792
URL: http://svn.apache.org/viewvc?rev=1771792&view=rev
Log:
TOBAGO-1624 TabGroup: new switchType="none"
* add an example
* fix an example
[developed by hnoeth]
Modified:
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TabController.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/070-tab/01-ajax/tab-ajax.xhtml
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TabController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TabController.java?rev=1771792&r1=1771791&r2=1771792&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TabController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TabController.java Mon Nov 28 18:40:50 2016
@@ -34,8 +34,8 @@ public class TabController implements Se
private static final Logger LOG = LoggerFactory.getLogger(TabController.class);
- private String open = "image/feather-open.png";
- private String close = "image/feather.png";
+ private String open = "/image/feather-open.png";
+ private String close = "/image/feather.png";
private int index;
private SimpleTabChangeListener tabChangeListener;
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/070-tab/01-ajax/tab-ajax.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/070-tab/01-ajax/tab-ajax.xhtml?rev=1771792&r1=1771791&r2=1771792&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/070-tab/01-ajax/tab-ajax.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/070-tab/01-ajax/tab-ajax.xhtml Mon Nov 28 18:40:50 2016
@@ -80,14 +80,14 @@
<tc:section label="Open Folder Example">
<p>The image in the header depends on what tab is currently selected.</p>
<pre><code class="language-markup"><tc:tabGroup selectedIndex="\#{tabController.index}"></code></pre>
- <tc:tabGroup switchType="reloadTab" selectedIndex="#{tabController.index}">
- <tc:tab label="One" image="#{tabController.tabOneImage}">
+ <tc:tabGroup id="ft" switchType="reloadTab" selectedIndex="#{tabController.index}">
+ <tc:tab id="ft1" label="One" image="#{tabController.tabOneImage}">
<p>First folder open.</p>
</tc:tab>
- <tc:tab label="Two" image="#{tabController.tabTwoImage}">
+ <tc:tab id="ft2" label="Two" image="#{tabController.tabTwoImage}">
<p>Second folder open.</p>
</tc:tab>
- <tc:tab label="Three" image="#{tabController.tabThreeImage}">
+ <tc:tab id="ft3" label="Three" image="#{tabController.tabThreeImage}">
<p>Third folder open.</p>
</tc:tab>
</tc:tabGroup>
@@ -121,4 +121,30 @@
<tc:out label="TabChangedCount" value="#{tabController.count}"/>
</tc:box>
</tc:section>
+
+ <tc:section label="SwitchType='none'">
+ <p>If no switch type is activated with <code>switchType="none"</code>, you have full control over the tab group.
+ In this example the tabs are used as buttons to refresh the timestamps. The functionallity of
+ switching the tab comes explicitly by adding the id of the tab group to the ajax tag.</p>
+ <tc:tabGroup id="tabGroupSwitchTypeNone" switchType="none">
+ <tc:tab id="nt1" label="One">
+ <f:ajax execute="::tabGroupSwitchTypeNone" render="::tabGroupSwitchTypeNone ::outTimestamp1"/>
+ One
+ </tc:tab>
+ <tc:tab id="nt2" label="Two">
+ <f:ajax execute="::tabGroupSwitchTypeNone" render="::tabGroupSwitchTypeNone ::outTimestamp2"/>
+ Two
+ </tc:tab>
+ <tc:tab id="nt3" label="Three">
+ <f:ajax execute="::tabGroupSwitchTypeNone" render="::tabGroupSwitchTypeNone ::outTimestamp3"/>
+ Three
+ </tc:tab>
+ </tc:tabGroup>
+
+ <tc:box label="Area outsite of the tab group">
+ <tc:out id="outTimestamp1" label="Timestamp One" value="#{eventController.currentTimestamp}"/>
+ <tc:out id="outTimestamp2" label="Timestamp Two" value="#{eventController.currentTimestamp}"/>
+ <tc:out id="outTimestamp3" label="Timestamp Three" value="#{eventController.currentTimestamp}"/>
+ </tc:box>
+ </tc:section>
</ui:composition>