Author: abelevich
Date: 2008-03-11 11:09:31 -0400 (Tue, 11 Mar 2008)
New Revision: 6698
Modified:
trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml
trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
add layout="block/inline"
Modified: trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml
===================================================================
--- trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-03-11 15:08:49
UTC (rev 6697)
+++ trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-03-11 15:09:31
UTC (rev 6698)
@@ -38,6 +38,7 @@
<name>layout</name>
<classname>java.lang.String</classname>
<description>inline/block</description>
+ <defaultvalue><![CDATA["inline"]]></defaultvalue>
</property>
<property>
<name>inputMaxLength</name>
@@ -67,7 +68,7 @@
<name>defaultLabel</name>
<classname>java.lang.String</classname>
<description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
+
<defaultvalue><![CDATA["\u00a0\u00a0\u00a0"]]></defaultvalue>
</property>
<property>
<name>showControls</name>
Modified:
trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
===================================================================
---
trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2008-03-11
15:08:49 UTC (rev 6697)
+++
trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2008-03-11
15:09:31 UTC (rev 6698)
@@ -5,9 +5,11 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
import javax.faces.convert.Converter;
import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.renderkit.ComponentVariables;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
import org.ajax4jsf.util.InputUtils;
import org.apache.commons.logging.Log;
@@ -128,7 +130,7 @@
return attributes.toString();
}
-
+
public String encodeScriptEvents(FacesContext context, UIComponent component) {
StringBuffer events = new StringBuffer();
@@ -172,35 +174,35 @@
StringBuffer stringBuffer = new StringBuffer();
switch (key) {
- case NORMAL_KEY:
- stringBuffer.append(INPLACE_CSS_PUBLIC);
- stringBuffer.append(" ");
- stringBuffer.append(INPLACE_CSS_PUBLIC + "-" + suffix);
- value = component.getAttributes().get(suffix + "Class");
- if (value != null) {
- stringBuffer.append(" ");
- stringBuffer.append(value);
- }
- break;
- case HOVERED_KEY:
- stringBuffer.append(INPLACE_CSS_PUBLIC + "-" + "input-" + suffix
+ "-" + INPLACE_CSS_HOVER);
- value = component.getAttributes().get(suffix + "HoverClass");
- if (value != null) {
- stringBuffer.append(" ");
- stringBuffer.append(value);
- }
- break;
-
- case EDITABLE_KEY:
- stringBuffer.append(INPLACE_CSS_PUBLIC);
- stringBuffer.append(" ");
- stringBuffer.append(INPLACE_CSS_PUBLIC + "-" + suffix);
- value = component.getAttributes().get(suffix + "Class");
- if (value != null) {
- stringBuffer.append(" ");
- stringBuffer.append(value);
- }
- break;
+ case NORMAL_KEY:
+ stringBuffer.append(INPLACE_CSS_PUBLIC);
+ stringBuffer.append(" ");
+ stringBuffer.append(INPLACE_CSS_PUBLIC + "-" + suffix);
+ value = component.getAttributes().get(suffix + "Class");
+ if (value != null) {
+ stringBuffer.append(" ");
+ stringBuffer.append(value);
+ }
+ break;
+ case HOVERED_KEY:
+ stringBuffer.append(INPLACE_CSS_PUBLIC + "-" + "input-" + suffix
+ "-" + INPLACE_CSS_HOVER);
+ value = component.getAttributes().get(suffix + "HoverClass");
+ if (value != null) {
+ stringBuffer.append(" ");
+ stringBuffer.append(value);
+ }
+ break;
+
+ case EDITABLE_KEY:
+ stringBuffer.append(INPLACE_CSS_PUBLIC);
+ stringBuffer.append(" ");
+ stringBuffer.append(INPLACE_CSS_PUBLIC + "-" + suffix);
+ value = component.getAttributes().get(suffix + "Class");
+ if (value != null) {
+ stringBuffer.append(" ");
+ stringBuffer.append(value);
+ }
+ break;
}
return stringBuffer.toString();
}
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-11 15:08:49 UTC
(rev 6697)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-11 15:09:31 UTC
(rev 6698)
@@ -21,7 +21,7 @@
<f:resource var="cancelIcon"
name="org.richfaces.renderkit.html.images.CancelControlIcon"/>
<f:resource var="spacer" name="images/spacer.gif"/>
-
+
<f:clientid var="clientId" />
<jsp:scriptlet>
<![CDATA[
@@ -54,11 +54,31 @@
variables.setVariable("controlHoverClass", controlHoveredClass);
String controlPressedClass =
(String)component.getAttributes().get("controlPressedClass");
variables.setVariable("controlPressedClass", controlPressedClass);
+
+ String layout = (String)component.getAttributes().get("layout");
+ if (layout != null && layout.length() != 0) {
+ if (!layout.equals("block")) {
+ layout = "inline";
+ }
+ } else {
+ layout = "inline";
+ }
+
+ if (layout.equals("inline")) {
+
]]>
</jsp:scriptlet>
+ <span id="#{clientId}" class='rich-inplace rich-inplace-view
#{component.attributes["styleClass"]}'
+ x:passThruWithExclusions="id,styleClass,class,style">
+ <jsp:scriptlet>
+ } else {
+ </jsp:scriptlet>
+ <div id="#{clientId}" class='rich-inplace rich-inplace-view
#{component.attributes["styleClass"]}'
+ x:passThruWithExclusions="id,styleClass,class,style">
+ <jsp:scriptlet>
+ }
+ </jsp:scriptlet>
- <span id="#{clientId}" class='rich-inplace rich-inplace-view
#{component.attributes["styleClass"]}'
- x:passThruWithExclusions="id,styleClass,class,style">
<input id="#{clientId}tabber" type="button" value=""
style="width: 1px; position: absolute; left: -32767px;" />
<input id='#{clientId}tempValue'
class='rich-inplace-field'
@@ -138,9 +158,20 @@
]]>
</jsp:scriptlet>
</div>
- #{value}
- </span>
+ #{value}
+ <jsp:scriptlet>
+
+ if (!layout.equals("inline")) {
+ </jsp:scriptlet>
+ </div>
+ <jsp:scriptlet>
+ } else {
+ </jsp:scriptlet>
+ </span>
+ <jsp:scriptlet>
+ }
+ </jsp:scriptlet>
<script type="text/javascript">
Show replies by date