Author: manaRH
Date: 2013-02-19 11:04:31 -0500 (Tue, 19 Feb 2013)
New Revision: 15406
Modified:
branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java
Log:
JBSEAM-5052 add the converter also during decode in UISelectItems
Modified:
branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java
===================================================================
---
branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java 2013-02-19
16:04:20 UTC (rev 15405)
+++
branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java 2013-02-19
16:04:31 UTC (rev 15406)
@@ -169,18 +169,28 @@
public abstract void setItemValue(Object itemValue);
@Override
+ public void decode(FacesContext context) {
+ super.decode(context);
+ addConverterChainIfRequired();
+ }
+
+ @Override
public void encodeEnd(FacesContext context) throws IOException {
- if(isShowNoSelectionLabel()){
- ConverterChain converterChain = new ConverterChain(this.getParent());
- Converter noSelectionConverter = new NoSelectionConverter();
- // Make sure that the converter is only added once
- if (!converterChain.containsConverterType(noSelectionConverter)) {
- converterChain.addConverterToChain(noSelectionConverter,
ConverterChain.CHAIN_START);
- }
- }
- super.encodeEnd(context);
+ super.encodeEnd(context);
+ addConverterChainIfRequired();
}
+ private void addConverterChainIfRequired() {
+ if(isShowNoSelectionLabel()){
+ ConverterChain converterChain = new ConverterChain(this.getParent());
+ Converter noSelectionConverter = new NoSelectionConverter();
+ // Make sure that the converter is only added once
+ if (!converterChain.containsConverterType(noSelectionConverter)) {
+ converterChain.addConverterToChain(noSelectionConverter,
ConverterChain.CHAIN_START);
+ }
+ }
+ }
+
@Override
@Attribute(description = @Description("an EL expression specifying the data that
backs the List<SelectItem>"))
public Object getValue()
@@ -343,5 +353,4 @@
return Arrays.asList((Object[]) array);
}
}
-
}