Author: A.Skokov
Date: 2007-08-02 07:52:18 -0400 (Thu, 02 Aug 2007)
New Revision: 2003
Modified:
trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/css/slider.xcss
trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
Log:
http://jira.jboss.com/jira/browse/RF-455
Modified: trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml
===================================================================
--- trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml 2007-08-02
08:43:27 UTC (rev 2002)
+++ trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml 2007-08-02
11:52:18 UTC (rev 2003)
@@ -216,8 +216,14 @@
<description>
A ValueExpression enabled attribute that, if present, will be used as the text of
the validator message, replacing any message that comes from the validator
</description>
- </property>
- &ui_component_attributes;
+ </property>
+ <property>
+ <name>inputPosition</name>
+ <classname>java.lang.String</classname>
+ <description>If "right" the InputText Box would be rendered
on the right side of the ruler</description>
+ <defaultvalue><![CDATA["right"]]></defaultvalue>
+ </property>
+ &ui_component_attributes;
&html_input_attributes;
&html_input_events;
&ui_input_attributes;
Modified:
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/css/slider.xcss
===================================================================
---
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/css/slider.xcss 2007-08-02
08:43:27 UTC (rev 2002)
+++
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/css/slider.xcss 2007-08-02
11:52:18 UTC (rev 2003)
@@ -65,11 +65,19 @@
.dr-insldr-field {
border: 1px solid;
padding: 0px 0px 0px 3px;
- margin: 0px 0px 0px 10px;
+ margin-top: 0px;
+ margin-bottom: 0px;
background-position: left top;
background-repeat: repeat-x;
}
- ]]>
+.dr-insldr-field-left {
+ margin-right: 10px;
+}
+.dr-insldr-field-right {
+ margin-left: 10px;
+}
+
+ ]]>
</f:verbatim>
<u:selector name=".dr-insldr-tip">
@@ -105,7 +113,7 @@
<u:selector name=".dr-insldr-track-decor-1">
<u:style name="border-color" skin="panelBorderColor"/>
</u:selector>
-
+
<u:selector name=".dr-insldr-handler">
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.images.SliderArrowImage"
/>
Modified: trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
===================================================================
--- trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-08-02
08:43:27 UTC (rev 2002)
+++ trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-08-02
11:52:18 UTC (rev 2003)
@@ -17,11 +17,69 @@
<f:resource name="org.richfaces.renderkit.html.images.SliderArrowImage"
var="arrow" />
<f:resource
name="org.richfaces.renderkit.html.images.SliderArrowSelectedImage"
var="arrowSelected" />
- <table id="#{clientId}" border="0" cellpadding="0"
cellspacing="0" class="rich-slider
#{component.attributes['styleClass']}"
+ <jsp:scriptlet><![CDATA[
+ String inputPosition =
(String)component.getAttributes().get("inputPosition");
+
+ boolean disabled = attributeToBoolean(component, "disabled");
+ boolean showInput = attributeToBoolean(component, "showInput");
+ boolean manualInput = attributeToBoolean(component,
"enableManualInput");
+
+ variables.setVariable("inputReadOnly",new Boolean(!manualInput));
+ variables.setVariable("inputDisabled",new Boolean(disabled));
+
+ if (!manualInput || disabled){
+ variables.setVariable("color", "color: gray;");
+ }
+ else{
+ variables.setVariable("color", "");
+ }
+
+ variables.setVariable("inputSize",
component.getAttributes().get("inputSize"));
+ ]]></jsp:scriptlet>
+
+ <table id="#{clientId}" border="0" cellpadding="0"
cellspacing="0" class="rich-slider
#{component.attributes['styleClass']}"
style="width:#{component.attributes['width']};#{component.attributes['style']}"
x:passThruWithExclusions="id,boundClass,tipClass">
<tbody>
<tr>
- <td class="dr-insldr-left-num rich-inslider-left-num
#{component.attributes['boundClass']}">
+ <jsp:scriptlet><![CDATA[
+ if ("left".equalsIgnoreCase(inputPosition)) {
+ ]]></jsp:scriptlet>
+ <td rowspan="2" style="text-align: right;
vertical-align: bottom">
+ <jsp:scriptlet><![CDATA[
+ if (showInput) {
+ ]]></jsp:scriptlet>
+ <input id="#{clientId}Input"
+ name="#{clientId}"
+
value="#{this:getInputValue(context,component)}"
+ type="text"
+ class="dr-insldr-field dr-insldr-field-left
rich-inslider-field #{component.attributes['inputClass']}"
+
style="#{component.attributes['inputStyle']}; #{color}"
+ readonly="#{inputReadOnly}"
+ disabled="#{disabled}"
+
onselect="#{component.attributes['onselect']}"
+
onfocus="#{component.attributes['onfocus']}"
+
onblur="#{component.attributes['onblur']}"
+
accesskey="#{component.attributes['accesskey']}"
+ size="#{inputSize}"
+
maxlength="#{component.attributes['maxlength']}"
+ />
+ <jsp:scriptlet><![CDATA[
+ } else {
+ ]]></jsp:scriptlet>
+ <input id="#{clientId}Input"
+ name="#{clientId}"
+
value="#{this:getInputValue(context,component)}"
+ type="hidden"
+ />
+ <jsp:scriptlet><![CDATA[
+ }
+ ]]></jsp:scriptlet>
+ </td>
+ <jsp:scriptlet><![CDATA[
+ }
+ ]]></jsp:scriptlet>
+
+ <td class="dr-insldr-left-num rich-inslider-left-num
#{component.attributes['boundClass']}">
<jsp:scriptlet><![CDATA[
if (attributeToBoolean(component, "showBoundaryValues")){
]]></jsp:scriptlet>
@@ -39,32 +97,19 @@
}
]]></jsp:scriptlet>
</td>
- <td rowspan="2" style="vertical-align : bottom">
+
+ <jsp:scriptlet><![CDATA[
+ if ("right".equalsIgnoreCase(inputPosition)) {
+ ]]></jsp:scriptlet>
+ <td rowspan="2" style="text-align: left;
vertical-align: bottom">
<jsp:scriptlet><![CDATA[
- boolean disabled = attributeToBoolean(component, "disabled");
- boolean showInput = attributeToBoolean(component, "showInput");
- boolean manualInput = attributeToBoolean(component,
"enableManualInput");
-
- variables.setVariable("inputReadOnly",new Boolean(!manualInput));
- variables.setVariable("inputDisabled",new Boolean(disabled));
-
- if (!manualInput || disabled){
- variables.setVariable("color", "color: gray;");
- }
- else{
- variables.setVariable("color", "");
- }
-
- variables.setVariable("inputSize",
component.getAttributes().get("inputSize"));
-
- //if (showInput || manualInput) {
- if (showInput) {
+ if (showInput) {
]]></jsp:scriptlet>
<input id="#{clientId}Input"
name="#{clientId}"
value="#{this:getInputValue(context,component)}"
type="text"
- class="dr-insldr-field rich-inslider-field
#{component.attributes['inputClass']}"
+ class="dr-insldr-field dr-insldr-field-right rich-inslider-field
#{component.attributes['inputClass']}"
style="#{component.attributes['inputStyle']}; #{color}"
readonly="#{inputReadOnly}"
disabled="#{disabled}"
@@ -84,10 +129,13 @@
type="hidden"
/>
<jsp:scriptlet><![CDATA[
- }
+ }
]]></jsp:scriptlet>
</td>
- </tr>
+ <jsp:scriptlet><![CDATA[
+ }
+ ]]></jsp:scriptlet>
+ </tr>
<tr>
<td colspan="2" class="dr-insldr-size
dr-insldr-vert-spacer">
<table border="0" cellpadding="0" cellspacing="0"
class="dr-insldr-size">