Author: abelevich
Date: 2011-01-14 07:51:16 -0500 (Fri, 14 Jan 2011)
New Revision: 21020
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
trunk/ui/input/ui/src/main/templates/select.template.xml
Log:
RF-10101 select: disabled works wrong
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2011-01-14
12:27:00 UTC (rev 21019)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2011-01-14
12:51:16 UTC (rev 21020)
@@ -23,6 +23,8 @@
public static final String COMPONENT_FAMILY = "org.richfaces.Select";
+ @Attribute
+ public abstract boolean isDisabled();
@Attribute()
public abstract boolean isEnableManualInput();
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss 2011-01-14
12:27:00 UTC (rev 21019)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss 2011-01-14
12:51:16 UTC (rev 21020)
@@ -60,6 +60,15 @@
height: 15px;
}
+.rf-sel-btn-dis {
+
+}
+
+.rf-sel-btn-dis .rf-sel-btn-arrow {
+ cursor: default;
+ background-image:
"url(#{resource['org.richfaces:combo_down_button_dis.gif']})";
+}
+
.rf-sel-lst-cord{
position: absolute;
/* TODO nick - review: font-size: 0px; */
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2011-01-14
12:27:00 UTC (rev 21019)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2011-01-14
12:51:16 UTC (rev 21020)
@@ -113,7 +113,7 @@
this.clientItems = mergedOptions.items;
- if(mergedOptions.showControl) {
+ if(mergedOptions.showControl && !mergedOptions.disabled) {
this.btn = $(document.getElementById(id+"Button"));
this.btn.bind("mousedown", $.proxy(this.__onBtnMouseDown, this));
this.btn.bind("mouseup", $.proxy(this.__onMouseUp, this));
@@ -150,7 +150,8 @@
itemCss: "rf-sel-opt",
selectItemCss: "rf-sel-sel",
listCss: "rf-sel-lst-cord",
- changeDelay: 8
+ changeDelay: 8,
+ disabled: false
};
var REGEXP_TRIM = /^[\n\s]*(.*)[\n\s]*$/;
Modified: trunk/ui/input/ui/src/main/templates/select.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/select.template.xml 2011-01-14 12:27:00 UTC (rev
21019)
+++ trunk/ui/input/ui/src/main/templates/select.template.xml 2011-01-14 12:51:16 UTC (rev
21020)
@@ -35,7 +35,7 @@
</div>
<c:if
test="#{component.attributes['showButton']}">
<c:if
test="#{component.attributes['disabled']}">
- <div id="#{clientId}Button"
class="rf-sel-btn">
+ <div id="#{clientId}Button" class="rf-sel-btn
rf-sel-btn-dis">
<div class="rf-sel-btn-arrow"></div>
</div>
</c:if>
@@ -70,7 +70,7 @@
<cdk:scriptOption name="itemCss"
value="rf-sel-opt" />
<cdk:scriptOption name="selectItemCss"
value="#{concatClasses('rf-sel-sel',
component.attributes['selectItemClass'])}" />
<cdk:scriptOption attributes="onbegin oncomplete onerror
onbeforedomupdate onchange onblur onselectitem onfocus"
wrapper="eventHandler"/>
- <cdk:scriptOption attributes="showControl defaultLabel enableManualInput
selectFirst" />
+ <cdk:scriptOption attributes="showControl defaultLabel enableManualInput
selectFirst disabled" />
</cdk:scriptObject>
new RichFaces.ui.Select("#{clientId}", #{toScriptArgs(options)});
</script>
Show replies by date