Author: abelevich
Date: 2008-04-14 10:46:43 -0400 (Mon, 14 Apr 2008)
New Revision: 7805
Modified:
branches/3.2.x/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java
branches/3.2.x/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
branches/3.2.x/ui/combobox/src/main/templates/combobox.jspx
Log:
http://jira.jboss.com/jira/browse/RF-3058
Modified:
branches/3.2.x/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java
===================================================================
---
branches/3.2.x/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java 2008-04-14
14:28:47 UTC (rev 7804)
+++
branches/3.2.x/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java 2008-04-14
14:46:43 UTC (rev 7805)
@@ -157,4 +157,8 @@
return ScriptUtils.toScript(result);
}
+
+public String encodeValue(String value){
+ return ScriptUtils.toScript(value);
+ }
}
Modified:
branches/3.2.x/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
===================================================================
---
branches/3.2.x/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2008-04-14
14:28:47 UTC (rev 7804)
+++
branches/3.2.x/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2008-04-14
14:46:43 UTC (rev 7805)
@@ -348,7 +348,7 @@
var items = this.getItems();
for (var i = 0; i < items.length; i++) {
var item = items[i]
- var itText = item.innerHTML;
+ var itText = item.innerHTML.unescapeHTML();
if (itText.substr(0, substr.length).toLowerCase() == substr.toLowerCase()) { //FIXME:
to optimaize
return item;
}
Modified: branches/3.2.x/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- branches/3.2.x/ui/combobox/src/main/templates/combobox.jspx 2008-04-14 14:28:47 UTC
(rev 7804)
+++ branches/3.2.x/ui/combobox/src/main/templates/combobox.jspx 2008-04-14 14:46:43 UTC
(rev 7805)
@@ -92,6 +92,9 @@
value = defaultLabel;
}
variables.setVariable("value", value);
+ String convertedValue = encodeValue((String)value);
+ variables.setVariable("convertedValue", convertedValue);
+
variables.setVariable("valueStyle", valueStyle);
Object inputStyle = component.getAttributes().get("inputStyle");
@@ -315,7 +318,7 @@
#{this:getAsEventHandler(context, component, "onlistcall")},
#{this:getAsEventHandler(context, component, "onselect")},
"#{defaultLabel}",
- #{disabled}, "#{value}",
+ #{disabled}, #{convertedValue},
#{component.attributes["showDelay"]},
#{component.attributes["hideDelay"]});
</script>
</div>