You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2012/12/12 14:40:49 UTC

svn commit: r1420671 - /myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRenderer.java

Author: werpu
Date: Wed Dec 12 13:40:47 2012
New Revision: 1420671

URL: http://svn.apache.org/viewvc?rev=1420671&view=rev
Log:
https://issues.apache.org/jira/browse/TOMAHAWK-1260 turning off autocomplete

Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRenderer.java

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRenderer.java?rev=1420671&r1=1420670&r2=1420671&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRenderer.java Wed Dec 12 13:40:47 2012
@@ -23,6 +23,8 @@ import org.apache.myfaces.shared_tomahaw
 import org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlRendererUtils;
 import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
 import org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils;
+import org.apache.myfaces.shared_tomahawk.renderkit.JSFAttr;
+
 import org.apache.myfaces.renderkit.html.util.AddResource;
 import org.apache.myfaces.custom.ajax.api.AjaxRenderer;
 import org.apache.myfaces.custom.ajax.util.AjaxRendererUtils;
@@ -75,8 +77,35 @@ public class HtmlInputTextAjaxRenderer e
         context.getExternalContext().getRequestMap().put(JAVASCRIPT_ENCODED, Boolean.TRUE);
     }
 
+    protected void renderInput(FacesContext facesContext, UIComponent component)
+          throws IOException
+      {
+          ResponseWriter writer = facesContext.getResponseWriter();
+
+          String clientId = component.getClientId(facesContext);
+          String value = org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.getStringValue(facesContext, component);
+
+          writer.startElement(HTML.INPUT_ELEM, component);
+          writer.writeAttribute(HTML.ID_ATTR, clientId, null);
+          writer.writeAttribute(HTML.NAME_ATTR, clientId, null);
+          writer.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_TEXT, null);
+
+          //autocomplete needs to be off
+          //https://issues.apache.org/jira/browse/TOMAHAWK-1260
+          writer.writeAttribute("autocomplete", "off", null);
+          if (value != null)
+          {
+              writer.writeAttribute(HTML.VALUE_ATTR, value, JSFAttr.VALUE_ATTR);
+          }
+
+          HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED);
+          if (isDisabled(facesContext, component))
+          {
+              writer.writeAttribute(HTML.DISABLED_ATTR, Boolean.TRUE, null);
+          }
 
-
+          writer.endElement(HTML.INPUT_ELEM);
+      }
 
     public void encodeEnd(FacesContext context, UIComponent component) throws IOException
     {