Author: abelevich
Date: 2008-04-14 12:09:05 -0400 (Mon, 14 Apr 2008)
New Revision: 7810
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
http://jira.jboss.com/jira/browse/RF-3058,
http://jira.jboss.com/jira/browse/RF-3059
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
---
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-04-14
16:07:48 UTC (rev 7809)
+++
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-04-14
16:09:05 UTC (rev 7810)
@@ -174,9 +174,10 @@
|| (this.clickOnBar || !this.comboList.isList)) {
//bug :
http://jira.jboss.com/jira/browse/RF-2810,
//will be corrected in a future version (
http://jira.jboss.com/jira/browse/RF-2814)
- this.invokeEvent(this.events.onchange, this.inplaceSelect, "onchange",
{itemValue : this.currentItemValue, itemText : this.tempValueKeeper.value});
- var unescapeText = this.tempValueKeeper.value.unescapeHTML();
- this.saveValue(this.currentItemValue, unescapeText);
+ var unescapedValue = this.currentItemValue;
+ this.invokeEvent(this.events.onchange, this.inplaceSelect, "onchange",
{itemValue : unescapedValue, itemText : this.tempValueKeeper.value});
+// var unescapeText = this.tempValueKeeper.value.unescapeHTML();
+ this.saveValue(unescapedValue, this.tempValueKeeper.value);
}
this.comboList.hide();
@@ -184,7 +185,7 @@
applyTmpValue : function() {
if (this.comboList.activeItem) {
- var userLabel = this.comboList.activeItem.innerHTML;
+ var userLabel = this.comboList.activeItem.innerHTML.unescapeHTML();
this.currentItemValue = this.comboList.activeItem.value;
this.tempValueKeeper.value = userLabel;
this.comboList.selectedItem = this.comboList.activeItem;
@@ -218,7 +219,7 @@
if (item) {
this.comboList.doSelectItem(item);
- $super(e, item.innerHTML);
+ $super(e, item.innerHTML.unescapeHTML());
} else {
$super(e, "");
}
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-04-14 16:07:48 UTC
(rev 7809)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-04-14 16:09:05 UTC
(rev 7810)
@@ -36,13 +36,18 @@
}
String fieldLabel = getSelectedItemLabel(context, component);
value = getConvertedStringValue(context, component,value);
- Object fieldValue = value;
+ String fieldValue = (String)value;
if (value == null || value.equals("")) {
fieldValue = "";
}
+
+
+ String encodedFieldValue = encodeValue(fieldValue);
+
variables.setVariable("fieldLabel", fieldLabel);
variables.setVariable("fieldValue", fieldValue);
+ variables.setVariable("encodedFieldValue", encodedFieldValue);
String saveIcon =
(String)component.getAttributes().get("saveControlIcon");
if (saveIcon != null && saveIcon.length() != 0 ) {
@@ -111,7 +116,7 @@
/>
<input id="#{clientId}inselArrow" readonly="readonly"
type="Text" value="" class="rich-inplace-select-arrow"
style='display:none;'/>
- <input id='#{clientId}inplaceValue' name='#{clientId'
type='hidden' value='#{fieldValue}'
+ <input id='#{clientId}inplaceValue' name='#{clientId}'
type='hidden' value='#{fieldValue}'
onchange='#{component.attributes["onchange"]}'>
</input>
<div id="#{clientId}bar" class="rich-inplace-select-control-set"
style="display:none;">
@@ -212,7 +217,7 @@
new Richfaces.InplaceSelect(new
Richfaces.InplaceSelectList('list#{clientId}', 'listParent#{clientId}',
true,
Richfaces.InplaceSelect.CLASSES.COMBO_LIST,
'#{component.attributes["listWidth"]}',
'#{component.attributes["listHeight"]}',
#{this:getItemsTextAsJSArray(context, component,items)}, null,
- '#{clientId}inplaceTmpValue',
'shadow#{clientId}', 0, 0, '#{fieldValue}'),
+ '#{clientId}inplaceTmpValue',
'shadow#{clientId}', 0, 0, #{encodedFieldValue}),
'#{clientId}', '#{clientId}inplaceTmpValue',
'#{clientId}inplaceValue', '#{clientId}tabber',
{defaultLabel :
'#{component.attributes["defaultLabel"]}',