Author: manaRH
Date: 2012-10-11 10:49:31 -0400 (Thu, 11 Oct 2012)
New Revision: 15277
Modified:
branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java
Log:
JBSEAM-5052 - UISelectItems adds NoSelectionConverter into ConverterChain in
encodeEnd method instead of in getValue() method
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
2012-10-11 14:49:22 UTC (rev 15276)
+++
branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java
2012-10-11 14:49:31 UTC (rev 15277)
@@ -2,6 +2,7 @@
import static org.jboss.seam.util.Strings.emptyIfNull;
+import java.io.IOException;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
@@ -10,6 +11,7 @@
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.component.ValueHolder;
+import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.model.DataModel;
@@ -163,6 +165,19 @@
public abstract void setItemValue(Object itemValue);
@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);
+ }
+
+ @Override
public Object getValue()
{
List<javax.faces.model.SelectItem> temporarySelectItems = new
ArrayList<javax.faces.model.SelectItem>();
@@ -249,12 +264,6 @@
if (isShowNoSelectionLabel())
{
NullableSelectItem s = new NullableSelectItem(NO_SELECTION_VALUE,
getNoSelectionLabel());
- 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);
- }
return s;
}
else
_______________________________________________
seam-commits mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/seam-commits