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 2014/02/26 09:52:25 UTC
svn commit: r1571966 - in
/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main:
java/org/apache/myfaces/tobago/example/demo/overview/OverviewController.java
webapp/content/01-basic/basic.xhtml webapp/content/05-toolBar/toolBar.xhtml
Author: lofwyr
Date: Wed Feb 26 08:52:25 2014
New Revision: 1571966
URL: http://svn.apache.org/r1571966
Log:
TOBAGO-1371: Radio buttons should render icons, if available
- example
Modified:
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/overview/OverviewController.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/basic.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/05-toolBar/toolBar.xhtml
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/overview/OverviewController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/overview/OverviewController.java?rev=1571966&r1=1571965&r2=1571966&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/overview/OverviewController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/overview/OverviewController.java Wed Feb 26 08:52:25 2014
@@ -45,6 +45,7 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
+import java.util.Currency;
import java.util.Date;
import java.util.List;
@@ -69,7 +70,8 @@ public class OverviewController implemen
Selectable.SIBLING_LEAF_ONLY.getValue()
};
- private Salutation radioValue;
+ private String radioValue;
+ private Currency[] currencyItems;
private Salutation singleValue;
@@ -110,7 +112,13 @@ public class OverviewController implemen
public OverviewController() {
- radioValue = Salutation.UNKNOWN;
+ radioValue = "JPY";
+ currencyItems = new Currency[]{
+ Currency.getInstance("JPY"),
+ Currency.getInstance("TTD"),
+ Currency.getInstance("USD"),
+ Currency.getInstance("EUR")
+ };
singleValue = Salutation.UNKNOWN;
treeSelectMode = TREE_SELECT_MODE_KEYS[3];
treeListboxSelectMode = TREELISTBOX_SELECT_MODE_KEYS[0];
@@ -266,6 +274,10 @@ public class OverviewController implemen
return "popupButton".equals(lastAction) || "popupButton2".equals(lastAction);
}
+ public Currency[] getCurrencyItems() {
+ return currencyItems;
+ }
+
public SelectItem[] getItems() {
return getSalutationSelectItems("overview");
}
@@ -286,11 +298,11 @@ public class OverviewController implemen
}
- public Salutation getRadioValue() {
+ public String getRadioValue() {
return radioValue;
}
- public void setRadioValue(final Salutation radioValue) {
+ public void setRadioValue(final String radioValue) {
this.radioValue = radioValue;
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/basic.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/basic.xhtml?rev=1571966&r1=1571965&r2=1571966&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/basic.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/basic.xhtml Wed Feb 26 08:52:25 2014
@@ -80,12 +80,16 @@
<f:facet name="layout">
<tc:gridLayout columns="*;*" border="0"/>
</f:facet>
- <tc:selectOneRadio value="#{overviewController.radioValue}"
- id="rg0" converter="salutationId">
- <f:selectItems value="#{overviewController.items}" id="items0"/>
+ <tc:selectOneRadio 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>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/05-toolBar/toolBar.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/05-toolBar/toolBar.xhtml?rev=1571966&r1=1571965&r2=1571966&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/05-toolBar/toolBar.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/05-toolBar/toolBar.xhtml Wed Feb 26 08:52:25 2014
@@ -200,8 +200,10 @@
<tc:menu label="#{overviewBundle.toolbar_selectSingleselect}">
- <tx:menuRadio value="#{overviewController.radioValue}" converter="salutationId">
- <f:selectItems value="#{overviewController.items}"/>
+ <tx:menuRadio value="#{overviewController.radioValue}">
+ <tc:selectItems value="#{overviewController.currencyItems}"
+ var="currency" itemValue="#{currency.currencyCode}" itemLabel="#{currency.displayName}"
+ itemImage="data/#{currency.currencyCode}-14.png" />
</tx:menuRadio>
</tc:menu>