Author: abelevich
Date: 2008-02-05 12:57:49 -0500 (Tue, 05 Feb 2008)
New Revision: 5836
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
fix combobox behavior
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
===================================================================
---
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-02-05
17:26:40 UTC (rev 5835)
+++
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-02-05
17:57:49 UTC (rev 5836)
@@ -53,6 +53,11 @@
background-position:left top;
background-repeat:repeat-x;
}
+
+.rich-combobox-font-disabled {
+ color: #AAAAAA;
+
+}
.rich-combobox-list-position {
position : absolute;
top:1px;
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-02-05
17:26:40 UTC (rev 5835)
+++
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-02-05
17:57:49 UTC (rev 5836)
@@ -186,6 +186,7 @@
fieldBlurHandler : function(event) {
if (!this.comboList.isList) {
+ this.doNormal();
var value = this.field.value;
if (value.length == 0) {
this.applyDefaultText();
@@ -196,7 +197,6 @@
}
}
this.comboList.hideWithDelay();
- this.doNormal();
} else {
this.doActive();
}
@@ -296,6 +296,7 @@
},
applyDefaultText : function() {
+ this.field.className = this.classes.FIELD.CLASSES.DISABLED;
this.field.value = this.defaultMessage;
this.comboValue.value = "";
},
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-02-05 17:26:40 UTC
(rev 5835)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-02-05 17:57:49 UTC
(rev 5836)
@@ -79,13 +79,16 @@
variables.setVariable("selectFirstOnUpdate", selectFirstOnUpdate);
Object value = component.getAttributes().get("value");
+ String valueStyle = "rich-combobox-font-inactive";
value = getConvertedStringValue(context, component,value);
if (value == null || value.equals("")) {
+ valueStyle = "rich-combobox-font-disabled";
value = defaultLabel;
}
variables.setVariable("value", value);
+ variables.setVariable("valueStyle", valueStyle);
- Object inputStyle = component.getAttributes().get("inputStyle");
+ Object inputStyle = component.getAttributes().get("inputStyle");
variables.setVariable("inputStyle", inputStyle);
Object inputClass = component.getAttributes().get("inputClass");
@@ -184,23 +187,9 @@
buttonIconInactive = "url('" + buttonIconInactive +
"')";
}
variables.setVariable("buttonIconInactive", buttonIconInactive);
-
-
-
+
]]>
</jsp:scriptlet>
- <jsp:scriptlet>
- <![CDATA[
- if (listWidth == null) {
- ]]>
- </jsp:scriptlet>
- <style>
- </style>
- <jsp:scriptlet>
- <![CDATA[
- }
- ]]>
- </jsp:scriptlet>
<f:resource var="spacer" name="images/spacer.gif"/>
<f:resource name="org.richfaces.renderkit.images.ComboBoxListShadow"/>
<div id="control#{clientId}" class="rich-combobox-font rich-combobox
#{styleClass}" style="width:#{listWidth};#{style}"
@@ -211,7 +200,7 @@
<input id="comboboxField#{clientId}"
name="comboboxField#{clientId}"
disabled="#{disabled}"
- class="rich-combobox-font-inactive rich-combobox-input-inactive
#{inputDisabledClass}" type="text"
+ class="#{valueStyle} rich-combobox-input-inactive
#{inputDisabledClass}" type="text"
value="#{value}"
size="#{inputSize}"
onchange="#{component.attributes['onchange']}"
Show replies by date