You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sv...@apache.org on 2005/02/09 18:41:30 UTC
cvs commit: incubator-myfaces/doc release-notes.txt
svieujot 2005/02/09 09:41:30
Modified: tlds myfaces_ext.tld
src/components/org/apache/myfaces/custom/div Div.java
DivRenderer.java
doc release-notes.txt
Log:
Apply Sean Schofield's patch for MYFACES-104
Revision Changes Path
1.165 +1 -0 incubator-myfaces/tlds/myfaces_ext.tld
Index: myfaces_ext.tld
===================================================================
RCS file: /home/cvs/incubator-myfaces/tlds/myfaces_ext.tld,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -r1.164 -r1.165
--- myfaces_ext.tld 9 Feb 2005 13:05:20 -0000 1.164
+++ myfaces_ext.tld 9 Feb 2005 17:41:29 -0000 1.165
@@ -1443,6 +1443,7 @@
<body-content>JSP</body-content>
<description>Places a div around its children</description>
&ui_component_attributes;
+ &ext_forceId_attribute;
<attribute>
<name>style</name>
<required>false</required>
1.2 +21 -6 incubator-myfaces/src/components/org/apache/myfaces/custom/div/Div.java
Index: Div.java
===================================================================
RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/div/Div.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Div.java 8 Nov 2004 03:43:20 -0000 1.1
+++ Div.java 9 Feb 2005 17:41:30 -0000 1.2
@@ -18,12 +18,16 @@
import javax.faces.component.UIOutput;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+
+import org.apache.myfaces.component.html.util.HtmlComponentUtils;
+
/**
* @author bdudney (latest modification by $Author$)
* @version $Revision$ $Date$
* $Log$
+ * Revision 1.2 2005/02/09 17:41:30 svieujot
+ * Apply Sean Schofield's patch for MYFACES-104
+ *
* Revision 1.1 2004/11/08 03:43:20 bdudney
* Added a div element. x:div to use, inserts a div with class or style attributes
*
@@ -32,7 +36,7 @@
public static final String COMPONENT_TYPE = "org.apache.myfaces.Div";
public static final String COMPONENT_FAMILY = "javax.faces.Output";
private static final String DEFAULT_RENDERER_TYPE = DivRenderer.RENDERER_TYPE;
- private static final Log log = LogFactory.getLog(Div.class);
+
private String _style = null;
private String _styleClass = null;
@@ -45,6 +49,17 @@
return COMPONENT_FAMILY;
}
+ public String getClientId(FacesContext context)
+ {
+ String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
+ if (clientId == null)
+ {
+ clientId = super.getClientId(context);
+ }
+
+ return clientId;
+ }
+
public String getStyle() {
if (_style != null)
return _style;
1.4 +13 -8 incubator-myfaces/src/components/org/apache/myfaces/custom/div/DivRenderer.java
Index: DivRenderer.java
===================================================================
RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/div/DivRenderer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DivRenderer.java 27 Nov 2004 00:00:09 -0000 1.3
+++ DivRenderer.java 9 Feb 2005 17:41:30 -0000 1.4
@@ -16,17 +16,21 @@
package org.apache.myfaces.custom.div;
import java.io.IOException;
+
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+
import org.apache.myfaces.renderkit.html.HTML;
import org.apache.myfaces.renderkit.html.HtmlRenderer;
+import org.apache.myfaces.renderkit.html.HtmlRendererUtils;
/**
* @author bdudney (latest modification by $Author$)
* @version $Revision$ $Date$
* $Log$
+ * Revision 1.4 2005/02/09 17:41:30 svieujot
+ * Apply Sean Schofield's patch for MYFACES-104
+ *
* Revision 1.3 2004/11/27 00:00:09 svieujot
* Remove the limitation to have a style or a styleClass attribute because sometimes, just a plain <div> can be useful.
*
@@ -38,7 +42,6 @@
*
*/
public class DivRenderer extends HtmlRenderer {
- private static final Log log = LogFactory.getLog(DivRenderer.class);
public static final String RENDERER_TYPE = "org.apache.myfaces.DivRenderer";
public void encodeBegin(FacesContext context, UIComponent component)
@@ -48,7 +51,10 @@
}
Div div = (Div) component;
ResponseWriter writer = context.getResponseWriter();
- writer.write("<" + HTML.DIV_ELEM +" ");
+
+ writer.startElement(HTML.DIV_ELEM, component);
+ HtmlRendererUtils.writeIdIfNecessary(writer, component, context);
+
String styleClass = div.getStyleClass();
String style = div.getStyle();
if(null != styleClass && null != style) {
@@ -60,7 +66,6 @@
if(null != style) {
writer.write("style=\"" + style + "\"");
}
- writer.write(">");
}
public void encodeEnd(FacesContext context, UIComponent component)
@@ -69,6 +74,6 @@
throw new NullPointerException();
}
ResponseWriter writer = context.getResponseWriter();
- writer.write("</" + HTML.DIV_ELEM + ">");
+ writer.endElement(HTML.DIV_ELEM);
}
}
\ No newline at end of file
1.167 +1 -0 incubator-myfaces/doc/release-notes.txt
Index: release-notes.txt
===================================================================
RCS file: /home/cvs/incubator-myfaces/doc/release-notes.txt,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -r1.166 -r1.167
--- release-notes.txt 9 Feb 2005 13:05:21 -0000 1.166
+++ release-notes.txt 9 Feb 2005 17:41:30 -0000 1.167
@@ -19,6 +19,7 @@
* closed MYFACES-81 in Jira (StateManager.SerializedView should not implement Serializable)
* closed MFACES-76 in Jira
* closed MFACES-74 in Jira
+* closed MFACES-104 in Jira
----------------------------------------------------------------------
Changes in Release 1.0.8 beta_RC2
* added a new RenderKit, that renders WML. Thanks to Jiri Zaloudek for his contribution