Author: abelevich
Date: 2011-01-25 08:19:30 -0500 (Tue, 25 Jan 2011)
New Revision: 21202
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java
trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestDefault.xmlunit.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml
Log:
RF-9846 Inplace select generates not valid markup
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2011-01-25
13:01:38 UTC (rev 21201)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2011-01-25
13:19:30 UTC (rev 21202)
@@ -55,16 +55,16 @@
@Attribute(defaultValue="true")
public abstract boolean isSaveOnBlur();
- @Attribute()
+ @Attribute
public abstract InplaceState getState();
- @Attribute()
+ @Attribute
public abstract String getEditEvent();
- @Attribute()
+ @Attribute
public abstract boolean isShowControls();
- @Attribute()
+ @Attribute
public abstract String getInputWidth();
@Attribute
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2011-01-25
13:01:38 UTC (rev 21201)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2011-01-25
13:19:30 UTC (rev 21202)
@@ -47,7 +47,10 @@
public static final String COMPONENT_FAMILY = "org.richfaces.Select";
- @Attribute()
+ @Attribute
+ public abstract String getInputWidth();
+
+ @Attribute
public abstract InplaceState getState();
@Attribute
@@ -62,7 +65,7 @@
@Attribute(defaultValue="true")
public abstract boolean isSaveOnBlur();
- @Attribute()
+ @Attribute
public abstract boolean isShowControls();
@Attribute
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2011-01-25
13:01:38 UTC (rev 21201)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2011-01-25
13:19:30 UTC (rev 21202)
@@ -33,6 +33,7 @@
import org.richfaces.component.AbstractInplaceInput;
import org.richfaces.component.InplaceComponent;
import org.richfaces.component.InplaceState;
+import org.richfaces.renderkit.util.HtmlDimensions;
/**
* @author Anton Belevich
@@ -207,7 +208,7 @@
if (value == null || "".equals(value)) {
value = "100%";
}
- return value;
+ return HtmlDimensions.formatSize(value);
}
protected String getEditEvent(UIComponent component) {
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java 2011-01-25
13:01:38 UTC (rev 21201)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java 2011-01-25
13:19:30 UTC (rev 21202)
@@ -160,4 +160,13 @@
css = (css != null) ? concatClasses("rf-is-lst-cord", css) :
"rf-is-lst-cord";
return css;
}
+
+ protected String getInputWidthStyle(UIComponent component) {
+ String value = ((AbstractInplaceSelect) component).getInputWidth();
+ if (value == null || "".equals(value)) {
+ return "";
+ } else {
+ return "width: "+HtmlDimensions.formatSize(value)+";";
+ }
+ }
}
Modified: trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2011-01-25 13:01:38
UTC (rev 21201)
+++ trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2011-01-25 13:19:30
UTC (rev 21202)
@@ -50,7 +50,7 @@
<input id="#{clientId}selValue" name="#{clientId}"
type="hidden" value="#{getInputValue(facesContext, component)}"/>
<input id="#{clientId}Input" name="#{clientId}Input"
autocomplete="off"
type="text" value="#{getSelectInputLabel(facesContext,
component)}"
- class="rf-is-fld" style="width:
#{component.attributes['inputWidth']};" readonly="readonly"
+ class="rf-is-fld" style="#{getInputWidthStyle(component)}"
readonly="readonly"
cdk:passThrough="tabindex">
<cdk:call expression="renderInputHandlers(facesContext, component);"
/>
</input>
Modified:
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestDefault.xmlunit.xml
===================================================================
---
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestDefault.xmlunit.xml 2011-01-25
13:01:38 UTC (rev 21201)
+++
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestDefault.xmlunit.xml 2011-01-25
13:19:30 UTC (rev 21202)
@@ -3,7 +3,7 @@
<input class="rf-is-none" id="form:inplaceSelectDefaultFocus"
name="form:inplaceSelectDefaultFocus" style="position: absolute; top: 0px;
left: 0px; outline-style: none;" type="image" />
<span class="rf-is-edit rf-is-none"
id="form:inplaceSelectDefaultEdit">
<input id="form:inplaceSelectDefaultselValue"
name="form:inplaceSelectDefault" type="hidden" />
- <input autocomplete="off" class="rf-is-fld"
id="form:inplaceSelectDefaultInput"
name="form:inplaceSelectDefaultInput" readonly="readonly"
style="width: ;" type="text" />
+ <input autocomplete="off" class="rf-is-fld"
id="form:inplaceSelectDefaultInput"
name="form:inplaceSelectDefaultInput" readonly="readonly"
type="text" />
<span class="rf-is-lst-cord" id="form:inplaceSelectDefaultList"
style="display: none">
<span class="rf-is-lst-pos" style="width: 200px">
<span class="rf-is-shdw">
Modified:
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml
===================================================================
---
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml 2011-01-25
13:01:38 UTC (rev 21201)
+++
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml 2011-01-25
13:19:30 UTC (rev 21202)
@@ -3,7 +3,7 @@
<input class="rf-is-none" id="form:inplaceSelectEditFocus"
name="form:inplaceSelectEditFocus" style="position: absolute; top: 0px;
left: 0px; outline-style: none;" type="image" />
<span class="rf-is-edit" id="form:inplaceSelectEditEdit">
<input id="form:inplaceSelectEditselValue"
name="form:inplaceSelectEdit" type="hidden" />
- <input autocomplete="off" class="rf-is-fld"
id="form:inplaceSelectEditInput" name="form:inplaceSelectEditInput"
readonly="readonly" style="width: ;" type="text" />
+ <input autocomplete="off" class="rf-is-fld"
id="form:inplaceSelectEditInput" name="form:inplaceSelectEditInput"
readonly="readonly" type="text" />
<span class="rf-is-btn-prepos">
<span class="rf-is-btn-pos">
<span class="rf-is-shdw"
id="form:inplaceSelectEditBtnshadow">
Modified:
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml
===================================================================
---
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml 2011-01-25
13:01:38 UTC (rev 21201)
+++
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml 2011-01-25
13:19:30 UTC (rev 21202)
@@ -3,7 +3,7 @@
<input class="rf-is-none"
id="form:inplaceSelectWithControlsFocus"
name="form:inplaceSelectWithControlsFocus" style="position: absolute; top:
0px; left: 0px; outline-style: none;" type="image" />
<span class="rf-is-edit rf-is-none"
id="form:inplaceSelectWithControlsEdit">
<input id="form:inplaceSelectWithControlsselValue"
name="form:inplaceSelectWithControls" type="hidden" />
- <input autocomplete="off" class="rf-is-fld"
id="form:inplaceSelectWithControlsInput"
name="form:inplaceSelectWithControlsInput" readonly="readonly"
style="width: ;" type="text" />
+ <input autocomplete="off" class="rf-is-fld"
id="form:inplaceSelectWithControlsInput"
name="form:inplaceSelectWithControlsInput" readonly="readonly"
type="text" />
<span class="rf-is-btn-prepos">
<span class="rf-is-btn-pos">
<span class="rf-is-shdw"
id="form:inplaceSelectWithControlsBtnshadow">
Show replies by date