Author: alevkovsky
Date: 2008-10-20 11:34:45 -0400 (Mon, 20 Oct 2008)
New Revision: 10841
Modified:
trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/UIEditor.java
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
trunk/sandbox/ui/editor/src/main/templates/editor.jspx
Log:
Change Editor text area name
Modified: trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/UIEditor.java
===================================================================
--- trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/UIEditor.java 2008-10-20
15:32:09 UTC (rev 10840)
+++ trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/UIEditor.java 2008-10-20
15:34:45 UTC (rev 10841)
@@ -19,6 +19,8 @@
public static final String COMPONENT_TYPE = "org.richfaces.Editor";
public static final String COMPONENT_FAMILY = "org.richfaces.Editor";
+
+ public static final String EDITOR_TEXT_AREA_ID_SUFFIX = "TextArea";
public abstract void setType(String type);
Modified:
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
===================================================================
---
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-10-20
15:32:09 UTC (rev 10840)
+++
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-10-20
15:34:45 UTC (rev 10841)
@@ -26,6 +26,7 @@
import java.util.Map;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
import javax.faces.component.UIParameter;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -79,4 +80,18 @@
UIEditor component, Object value) {
return InputUtils.getConvertedStringValue(context, component, value);
}
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ String clientId = component.getClientId(context) +
UIEditor.EDITOR_TEXT_AREA_ID_SUFFIX;
+ Map requestParameterMap = context.getExternalContext().getRequestParameterMap();
+ String newValue = (String) requestParameterMap.get(clientId);
+ if (null != newValue) {
+ UIInput input = (UIInput) component;
+ input.setSubmittedValue(newValue);
+ }
+ }
+
+
}
Modified: trunk/sandbox/ui/editor/src/main/templates/editor.jspx
===================================================================
--- trunk/sandbox/ui/editor/src/main/templates/editor.jspx 2008-10-20 15:32:09 UTC (rev
10840)
+++ trunk/sandbox/ui/editor/src/main/templates/editor.jspx 2008-10-20 15:34:45 UTC (rev
10841)
@@ -16,7 +16,7 @@
<div id="#{clientId}" x:passThruWithExclusions="id,value"
class="rich-editor">
- <textarea id="#{clientId}TextArea" name='#{clientId}'
+ <textarea id="#{clientId}TextArea" name='#{clientId}TextArea'
style="width: #{component.attributes['width']}px; height:
#{component.attributes['height']}px;">
<jsp:scriptlet>
<![CDATA[
Show replies by date