[seam-commits] Seam SVN: r15227 - branches/community/Seam_2_3/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Mon Oct 8 17:49:57 EDT 2012
Author: manaRH
Date: 2012-10-08 17:49:57 -0400 (Mon, 08 Oct 2012)
New Revision: 15227
Modified:
branches/community/Seam_2_3/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/community/Seam_2_3/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java 2012-10-08 21:33:24 UTC (rev 15226)
+++ branches/community/Seam_2_3/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java 2012-10-08 21:49:57 UTC (rev 15227)
@@ -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
More information about the seam-commits
mailing list