Author: abelevich
Date: 2009-05-22 10:52:11 -0400 (Fri, 22 May 2009)
New Revision: 14282
Modified:
branches/community/3.3.X/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
branches/community/3.3.X/ui/combobox/src/main/templates/combobox.jspx
Log:
https://jira.jboss.org/jira/browse/RF-5524
Modified:
branches/community/3.3.X/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
---
branches/community/3.3.X/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2009-05-22
13:54:09 UTC (rev 14281)
+++
branches/community/3.3.X/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2009-05-22
14:52:11 UTC (rev 14282)
@@ -7,7 +7,7 @@
initialize: function(combobox, listId, parentListId, valueFieldId, fieldId, buttonId,
buttonBGId, shadowId, commonStyles, userStyles,
listWidth, listHeight, itemsText, directInputSuggestions, filterNewValue,
selectFirstOnUpdate, onlistcall, onlistclose, onselected, defaultMessage,
isDisabled, value,
- showDelay, hideDelay) {
+ showDelay, hideDelay, onchange) {
this.directInputSuggestions = directInputSuggestions;
this.filterNewValue = filterNewValue;
@@ -15,7 +15,8 @@
this.comboValue = document.getElementById(valueFieldId);
this.field = document.getElementById(fieldId);
this.tempItem;
-
+ this.onchange = onchange;
+
this.BUTTON_WIDTH = 17; //px
this.classes = Richfaces.mergeStyles(userStyles,commonStyles.getCommonStyles());
@@ -369,7 +370,13 @@
}
var value = jQuery(this.comboList.activeItem).text();
-
+
+ if(this.comboValue && value) {
+ if(this.comboValue.value != value) {
+ Richfaces.invokeEvent(this.onchange, this.combobox, "onchange",
{value:value});
+ }
+ }
+
if (toSetOnly) {
var oV = this.field.value;
if (oV == value) {
Modified: branches/community/3.3.X/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- branches/community/3.3.X/ui/combobox/src/main/templates/combobox.jspx 2009-05-22
13:54:09 UTC (rev 14281)
+++ branches/community/3.3.X/ui/combobox/src/main/templates/combobox.jspx 2009-05-22
14:52:11 UTC (rev 14282)
@@ -217,7 +217,6 @@
value="#{value}"
x:onblur="#{component.attributes['onblur']}"
onfocus = "#{component.attributes['onfocus']}"
- onchange = "#{component.attributes['onchange']}"
style="width:#{correction}; #{inputInactiveStyle}"
autocomplete="off"
tabindex="#{component.attributes['tabindex']}"
@@ -360,7 +359,7 @@
#{this:getAsEventHandler(context, component, "onselect")},
"#{defaultLabel}",
#{disabled}, #{convertedValue},
- #{component.attributes["showDelay"]},
#{component.attributes["hideDelay"]});
+ #{component.attributes["showDelay"]},
#{component.attributes["hideDelay"]}, #{this:getAsEventHandler(context,
component, "onchange")});
</script>
</div>
</f:root>