Author: abelevich
Date: 2008-01-11 07:43:31 -0500 (Fri, 11 Jan 2008)
New Revision: 5299
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:
add default background and disable background styles support
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-01-11
12:38:18 UTC (rev 5298)
+++
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-01-11
12:43:31 UTC (rev 5299)
@@ -139,6 +139,12 @@
cursor : pointer;
}
+.rich-combobox-button-background-disabled {
+ background : top repeat-x;
+ cursor : pointer;
+}
+
+
.rich-combobox-button-pressed-background {
background : top repeat-x;
cursor : pointer;
@@ -163,6 +169,13 @@
<u:style name="background-color" skin="tabBackgroundColor"/>
</u:selector>
+ <u:selector name=".rich-combobox-button-background-disabled">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.images.ComboBoxButtonGradient"
/>
+ </u:style>
+ <u:style name="background-color" skin="tabBackgroundColor"/>
+ </u:selector>
+
<u:selector name=".rich-combobox-button-pressed-background">
<u:style name="background-image">
<f:resource
f:key="org.richfaces.renderkit.images.ComboBoxButtonPressGradient" />
@@ -190,8 +203,6 @@
<u:style name="border-color" skin="panelBorderColor"/>
</u:selector>
-
-
<u:selector name=".rich-combobox-button-hovered">
<u:style name="border-color" skin="selectControlColor"/>
</u:selector>
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-11
12:38:18 UTC (rev 5298)
+++
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-11
12:43:31 UTC (rev 5299)
@@ -3,13 +3,14 @@
Richfaces.ComboBox.prototype = {
- initialize: function(combobox, listId, parentListId, fieldId, buttonId, classes,
listWidth, listHeight, itemsText, directInputSuggestions, filterNewValue,
selectFirstOnUpdate, onlistcall, onselected, defaultMessage, isDisabled) {
+ initialize: function(combobox, listId, parentListId, fieldId, buttonId,buttonBGId,
classes, listWidth, listHeight, itemsText, directInputSuggestions, filterNewValue,
selectFirstOnUpdate, onlistcall, onselected, defaultMessage, isDisabled) {
this.directInputSuggestions = directInputSuggestions;
this.filterNewValue = filterNewValue;
this.combobox = $(combobox);
this.field = $(fieldId);
this.button = $(buttonId);
+ this.buttonBG = $(buttonBGId);
var fieldDem = Richfaces.ComboBoxList.getElemXY(this.field);
fieldDem.height = this.field.offsetHeight;
this.comboList = new Richfaces.ComboBoxList(listId, parentListId, selectFirstOnUpdate,
classes.COMBO_LIST, listWidth, listHeight, itemsText, onlistcall, fieldDem);
@@ -197,10 +198,12 @@
doActive : function() {
this.button.className = this.classes.BUTTON.CLASSES.ACTIVE;
this.field.className = this.classes.FIELD.CLASSES.ACTIVE;
+ this.buttonBG.className = this.classes.BUTTONBG.CLASSES.ACTIVE;
},
doDisable : function() {
this.button.className = this.classes.BUTTON.CLASSES.DISABLED;
+ this.buttonBG.className = this.classes.BUTTONBG.CLASSES.DISABLED;
this.field.className = this.classes.FIELD.CLASSES.DISABLED;
this.button.disabled = true;
@@ -209,6 +212,7 @@
doNormal : function() {
this.button.className = this.classes.BUTTON.CLASSES.NORMAL;
+ this.buttonBG.className = this.classes.BUTTONBG.CLASSES.NORMAL;
this.field.className = this.classes.FIELD.CLASSES.NORMAL;
this.button.disabled = false;
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-11 12:38:18 UTC
(rev 5298)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-11 12:43:31 UTC
(rev 5299)
@@ -64,6 +64,9 @@
variables.setVariable("inputStyle", inputStyle);
Object inputClass = component.getAttributes().get("inputClass");
+ if(inputClass!=null && inputClass.equals("")) {
+ inputClass = null;
+ }
variables.setVariable("inputClass", inputClass);
Object inputDisabledStyle =
component.getAttributes().get("inputDisabledStyle");
@@ -73,9 +76,15 @@
variables.setVariable("inputDisabledStyle", inputDisabledStyle);
Object inputDisabledClass =
component.getAttributes().get("inputDisabledClass");
+ if(inputDisabledClass!=null && inputDisabledClass.equals("")) {
+ inputDisabledClass = null;
+ }
variables.setVariable("inputDisabledClass", inputDisabledClass);
Object buttonDisabledClass =
component.getAttributes().get("buttonDisabledClass");
+ if(buttonDisabledClass!=null && buttonDisabledClass.equals(""))
{
+ buttonDisabledClass = null;
+ }
variables.setVariable("buttonDisabledClass", buttonDisabledClass);
Object buttonDisabledStyle =
component.getAttributes().get("buttonDisabledStyle");
@@ -85,6 +94,9 @@
variables.setVariable("buttonDisabledStyle", buttonDisabledStyle);
Object buttonClass = component.getAttributes().get("buttonClass");
+ if(buttonClass!=null && buttonClass.equals("")) {
+ buttonClass = null;
+ }
variables.setVariable("buttonClass", buttonClass);
Object buttonStyle = component.getAttributes().get("buttonStyle");
@@ -100,6 +112,9 @@
variables.setVariable("listStyle", listStyle);
Object listClass = component.getAttributes().get("listClass");
+ if(listClass!=null && listClass.equals("")) {
+ listClass = null;
+ }
variables.setVariable("listClass", listClass);
Object listDisabledStyle =
component.getAttributes().get("listDisabledStyle");
@@ -109,6 +124,9 @@
variables.setVariable("listDisabledStyle", listDisabledStyle);
Object listDisabledClass =
component.getAttributes().get("listDisabledClass");
+ if(listDisabledClass!=null && listDisabledClass.equals("")) {
+ listDisabledClass = null;
+ }
variables.setVariable("listDisabledClass", listDisabledClass);
Object styleClass = component.getAttributes().get("styleClass");
@@ -118,12 +136,21 @@
variables.setVariable("style", style);
Object itemClass = component.getAttributes().get("itemClass");
+ if(itemClass!=null && itemClass.equals("")) {
+ itemClass = null;
+ }
variables.setVariable("itemClass", itemClass);
Object itemDisabledClass =
component.getAttributes().get("itemDisabledClass");
+ if(itemDisabledClass!=null && itemDisabledClass.equals("")) {
+ itemDisabledClass = null;
+ }
variables.setVariable("itemDisabledClass", itemDisabledClass);
Object itemSelectedClass =
component.getAttributes().get("itemSelectedClass");
+ if(itemSelectedClass!=null && itemSelectedClass.equals("")) {
+ itemSelectedClass = null;
+ }
variables.setVariable("itemSelectedClass", itemSelectedClass);
@@ -131,7 +158,16 @@
</jsp:scriptlet>
<div id="#{clientId}" class="rich-combobox-font rich-combobox-shell
#{styleClass}" style="width:#{listWidth}; #{style}">
- <input id="comboboxField#{clientId}"
name="comboboxField#{clientId}" disabled="#{disabled}"
class="rich-combobox-font-disabled rich-combobox-input-default-disabled
rich-combobox-input-disabled #{inputDisabledClass}" type="text"
value="#{value}" size="#{inputSize}" autocomplete="off"
style="width:#{listWidth}; #{inputStyle}">
+ <input id="comboboxField#{clientId}"
+ name="comboboxField#{clientId}"
+ disabled="#{disabled}"
+ class="rich-combobox-font-disabled rich-combobox-input-default-disabled
rich-combobox-input-disabled #{inputDisabledClass}" type="text"
+ value="#{value}"
+ size="#{inputSize}"
+ autocomplete="off"
+ style="width:#{listWidth}; #{inputStyle}"
+
x:passThruWithExclusions="value,name,type,id,styleClass,class,style,size,autocomplete,disabled"
+ >
</input>
<input id="comboBoxButtonBG#{clientId}" readonly="true"
type="text" value="" class="rich-combobox-font
rich-combobox-button-background rich-combobox-button">
</input>
@@ -161,7 +197,12 @@
{NORMAL: #{buttonDisabledStyle},
ACTIVE: #{buttonStyle},
DISABLED: #{buttonDisabledStyle}}
- },
+ },
+ BUTTONBG : {CLASSES :
+ {NORMAL:"rich-combobox-font-disabled
rich-combobox-button-background-disabled rich-combobox-button-disabled",
+ ACTIVE: "rich-combobox-font
rich-combobox-button-background rich-combobox-button",
+ DISABLED : "rich-combobox-font-disabled
rich-combobox-button-background-disabled rich-combobox-button-disabled"}
+ },
FIELD : {CLASSES:
{NORMAL : "rich-combobox-font-disabled rich-combobox-input-default-disabled
rich-combobox-input-disabled #{inputDisabledClass}",
ACTIVE : "rich-combobox-font rich-combobox-input-default rich-combobox-input
#{inputClass}",
@@ -189,7 +230,9 @@
"list#{clientId}",
"listParent#{clientId}",
"comboboxField#{clientId}",
- "comboboxButton#{clientId}", Richfaces.ComboBox.CLASSES,
+ "comboboxButton#{clientId}",
+ "comboBoxButtonBG#{clientId}",
+ Richfaces.ComboBox.CLASSES,
"#{listWidth}", "#{listHeight}",
#{this:getItemsTextAsJSArray(context, component)},
#{directInputSuggestions},