Author: abelevich
Date: 2010-12-02 09:07:40 -0500 (Thu, 02 Dec 2010)
New Revision: 20305
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.js
trunk/ui/input/ui/src/main/templates/select.template.xml
Log:
RF-9576
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 2010-12-02
13:25:54 UTC (rev 20304)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss 2010-12-02
14:07:40 UTC (rev 20305)
@@ -1,4 +1,3 @@
-
.rf-sel-inp, .rf-sel-opt {
color: '#{richSkin.generalTextColor}';
font-size: '#{richSkin.generalSizeFont}';
@@ -9,30 +8,42 @@
border-width: 0px;
background: none;
width: 100%;
+ color: '#{richSkin.generalTextColor}';
+ font-size: '#{richSkin.generalSizeFont}';
+ font-family: '#{richSkin.generalFamilyFont}';
}
+.rf-sel{
+ width:200px;
+ display:inline-block;
+}
+
.rf-sel-fld{
- width: 200px;
- position: inline-block;
border-width: 1px;
border-style: solid;
border-color: '#{richSkin.panelBorderColor}';
- display: inline-block;
background-image:
"url(#{resource['org.richfaces.renderkit.html.images.AutocompleteFieldGradient']})";
background-repeat: repeat-x;
background-position: top left;
background-color: '#{richSkin.controlBackgroundColor}';
+ width: 100%;
}
+.rf-sel-fld-err input{
+ color: #FF0000;
+}
+
.rf-sel-btn{
background-image:
"url(#{resource['org.richfaces.renderkit.html.images.AutocompleteButtonGradient']})";
background-repeat: repeat-x;
background-position: top left;
background-color: '#{richSkin.headerBackgroundColor}';
text-align: center;
- border-left-style: solid;
- border-left-width: 1px;
- border-left-color: '#{richSkin.panelBorderColor}';
+ border-style: solid;
+ border-width: 1px;
+ border-color: '#{richSkin.panelBorderColor}';
+ border-left-width: 0px;
+
width: 15px;
position: absolute;
top: 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 2010-12-02
13:25:54 UTC (rev 20304)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-12-02
14:07:40 UTC (rev 20305)
@@ -109,7 +109,9 @@
var inputLabel = this.getValue() ;
this.initialValue = (inputLabel != this.defaultLabel) ? inputLabel :
"";
this.selValueInput = $(document.getElementById(id+"selValue"));
+ this.field = $(document.getElementById(id+"Field"));
this.clientItems = mergedOptions.items;
+
if(mergedOptions.showControl) {
this.btn = $(document.getElementById(id+"Button"));
@@ -242,6 +244,14 @@
var newValue = this.getValue();
if(this.cache && this.cache.isCached(newValue)) {
this.__updateItems();
+
+ var items = this.popupList.__getItems();
+ if(items.length != 0) {
+ this.field.removeClass("rf-sel-fld-err");
+ } else {
+ this.field.addClass("rf-sel-fld-err");
+ }
+
if(!this.popupList.isVisible()) {
this.showPopup();
}
@@ -316,7 +326,9 @@
}
});
} else {
- var prevValue = this.selValueInput.val();
+ this.field.removeClass("rf-sel-fld-err");
+
+ var prevValue = this.selValueInput.val();
if(prevValue && prevValue != "") {
$.each(this.clientItems, function() {
if(this.value == prevValue) {
@@ -328,6 +340,7 @@
}
}
}
+
this.setValue(label);
this.selValueInput.val(value);
this.focused = false;
Modified: trunk/ui/input/ui/src/main/templates/select.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/select.template.xml 2010-12-02 13:25:54 UTC (rev
20304)
+++ trunk/ui/input/ui/src/main/templates/select.template.xml 2010-12-02 14:07:40 UTC (rev
20305)
@@ -19,19 +19,20 @@
<cdk:object type="java.lang.Object" name="disabled"
value="#{component.attributes['disabled']}" />
- <div id="#{clientId}" class="rf-sel-fld">
- <div style="position : relative; overflow : hidden; text-align :
left; padding-right : 21px;">
+ <div id="#{clientId}" class="rf-sel">
+ <div style="position : relative; overflow : hidden; text-align :
left; padding-right : 18px;">
<input id="#{clientId}selValue" name="#{clientId}"
type="hidden" value="#{getInputValue(facesContext, component)}"/>
- <input cdk:passThroughWithExclusions="class autocomplete id value
disabled name type readonly"
- id="#{clientId}Input"
- value="#{getSelectLabel(facesContext, component)}"
- disabled="#{disabled}"
- name="#{clientId}Input"
- type="text"
- class="rf-sel-fnt rf-sel-inp"
- autocomplete="off"
- readonly="#{component.attributes['enableManualInput'] ? '' :
'readonly'}"/>
-
+ <div id="#{clientId}Field" class="rf-sel-fld">
+ <input cdk:passThroughWithExclusions="class autocomplete id value
disabled name type readonly"
+ id="#{clientId}Input"
+ value="#{getSelectLabel(facesContext, component)}"
+ disabled="#{disabled}"
+ name="#{clientId}Input"
+ type="text"
+ class="rf-sel-inp"
+ autocomplete="off"
+ readonly="#{component.attributes['enableManualInput'] ? '' :
'readonly'}"/>
+ </div>
<c:if
test="#{component.attributes['showButton']}">
<c:if
test="#{component.attributes['disabled']}">
<div id="#{clientId}Button"
class="rf-sel-btn">