You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2011/05/04 12:48:00 UTC
svn commit: r1099403 -
/myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java
Author: lofwyr
Date: Wed May 4 10:48:00 2011
New Revision: 1099403
URL: http://svn.apache.org/viewvc?rev=1099403&view=rev
Log:
TOBAGO-995: TextArea applies always style class tobago-TextArea-required, if length validator is present
- patch applied
Modified:
myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java
Modified: myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java?rev=1099403&r1=1099402&r2=1099403&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java Wed May 4 10:48:00 2011
@@ -24,9 +24,7 @@ package org.apache.myfaces.tobago.render
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ROWS;
+import org.apache.myfaces.tobago.TobagoConstants;
import org.apache.myfaces.tobago.component.ComponentUtil;
import org.apache.myfaces.tobago.component.UIInput;
import org.apache.myfaces.tobago.renderkit.HtmlUtils;
@@ -36,14 +34,17 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.HtmlRendererUtil;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
-import org.apache.myfaces.tobago.TobagoConstants;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.validator.Validator;
import javax.faces.validator.LengthValidator;
+import javax.faces.validator.Validator;
import java.io.IOException;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ROWS;
+
public class TextAreaRenderer extends InputRendererBase {
private static final Log LOG = LogFactory.getLog(TextAreaRenderer.class);
@@ -108,7 +109,7 @@ public class TextAreaRenderer extends In
if (required || maxLength > 0) {
String rendererName = HtmlRendererUtil.getRendererName(facesContext, input);
final String[] cmds = {
- "new Tobago.In(\"" + input.getClientId(facesContext) + "\", true ,\""
+ "new Tobago.In(\"" + input.getClientId(facesContext) + "\"," + required + ",\""
+ StyleClasses.PREFIX + rendererName + "\" " + (maxLength > -1? "," + maxLength: "") + " );"
};
HtmlRendererUtil.writeScriptLoader(facesContext, null, cmds);