Author: vmolotkov
Date: 2008-01-03 11:23:55 -0500 (Thu, 03 Jan 2008)
New Revision: 5129
Modified:
trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
new component's attributes were added
Modified: trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml 2008-01-03 16:09:45
UTC (rev 5128)
+++ trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml 2008-01-03 16:23:55
UTC (rev 5129)
@@ -45,6 +45,11 @@
<description></description>
<defaultvalue>true</defaultvalue>
</property>
+ <property>
+ <name>defaultMessage</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
<property>
<name>listWidth</name>
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
---
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-03
16:09:45 UTC (rev 5128)
+++
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-03
16:23:55 UTC (rev 5129)
@@ -12,7 +12,7 @@
this.field = $(fieldId);
this.button = $(buttonId);
- this.defaultMessage = "Select a state..."; //defaultMessage;
+ this.defaultMessage = defaultMessage;
this.onselected = onselected;
@@ -35,6 +35,10 @@
if (this.onselected) {
this.combobox.observe("rich:onselected", this.onselected);
}
+
+ if (this.defaultMessage) {
+ this.applyDefaultText();
+ }
},
clickHandler : function(event) {
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-03 16:09:45 UTC
(rev 5128)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-03 16:23:55 UTC
(rev 5129)
@@ -46,6 +46,9 @@
inputSize = HtmlUtil.qualifySize(inputSize);
}
variables.setVariable("inputSize", inputSize);
+
+ String defaultMessage = (String)
component.getAttributes().get("defaultMessage");
+ variables.setVariable("defaultMessage", defaultMessage);
]]>
@@ -78,6 +81,7 @@
#{directInputSuggestions},
#{filterNewValues},
#{this:getAsEventHandler(context, component, "onlistcall")},
- #{this:getAsEventHandler(context, component, "onselected")});
+ #{this:getAsEventHandler(context, component, "onselected")},
+ "#{defaultMessage}");
</script>
</f:root>
\ No newline at end of file
Show replies by date