[seam-commits] Seam SVN: r8406 - in trunk/ui/src/main: java/org/jboss/seam/ui/component and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Jun 24 02:36:54 EDT 2008


Author: pete.muir at jboss.org
Date: 2008-06-24 02:36:54 -0400 (Tue, 24 Jun 2008)
New Revision: 8406

Modified:
   trunk/ui/src/main/config/component/selectItems.xml
   trunk/ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java
Log:
JBSEAM-3004

Modified: trunk/ui/src/main/config/component/selectItems.xml
===================================================================
--- trunk/ui/src/main/config/component/selectItems.xml	2008-06-24 00:55:51 UTC (rev 8405)
+++ trunk/ui/src/main/config/component/selectItems.xml	2008-06-24 06:36:54 UTC (rev 8406)
@@ -55,5 +55,11 @@
 			<description>if true, the noSelectionLabel will be hidden when a value is selected</description>
 			<defaultvalue>false</defaultvalue>
 		</property>
+		<property>
+			<name>escape</name>
+			<classname>java.lang.Boolean</classname>
+			<description>if false, characters in the label will not be escaped. Beware that this is a safety issue when the label is in any way derived from input supplied by the application's user. . Can reference the var variable</description>
+			<defaultvalue>true</defaultvalue>
+		</property>
 	</component>
 </components>

Modified: trunk/ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java	2008-06-24 00:55:51 UTC (rev 8405)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/component/UISelectItems.java	2008-06-24 06:36:54 UTC (rev 8406)
@@ -81,13 +81,14 @@
       protected abstract Object getSelectItemValue();
       protected abstract String getSelectItemLabel();
       protected abstract Boolean getSelectItemDisabled();
-      
+      protected abstract Boolean getSelectItemEscape();
+
       protected javax.faces.model.SelectItem create()
       {
          try
          {
             setup();
-            return new javax.faces.model.SelectItem(this.getSelectItemValue(), this.getSelectItemLabel(), "", this.getSelectItemDisabled());
+            return new javax.faces.model.SelectItem(this.getSelectItemValue(), this.getSelectItemLabel(), "", this.getSelectItemDisabled(), this.getSelectItemEscape());
          }
          finally
          {
@@ -138,6 +139,10 @@
    
    public abstract void setDisabled(Boolean disabled);
    
+   public abstract Boolean getEscape();
+
+   public abstract void setEscape(Boolean escape);
+
    public abstract Object getItemValue();
    
    public abstract void setItemValue(Object itemValue);
@@ -198,6 +203,13 @@
             }
 
             @Override
+            protected Boolean getSelectItemEscape()
+            {
+               Boolean escape = getEscape();
+               return escape == null ? true : escape;
+            }
+
+            @Override
             protected String getSelectItemLabel()
             {
                return emptyIfNull(getLabel());




More information about the seam-commits mailing list