myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From haz...@apache.org
Subject svn commit: r699134 - /myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRenderer.java
Date Thu, 25 Sep 2008 23:44:51 GMT
Author: hazems
Date: Thu Sep 25 16:44:51 2008
New Revision: 699134

URL: http://svn.apache.org/viewvc?rev=699134&view=rev
Log:
https://issues.apache.org/jira/browse/TOMAHAWK-1340, onchange and styleClass are not rendered
in inputTextAjax

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=699134&r1=699133&r2=699134&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
Thu Sep 25 16:44:51 2008
@@ -94,12 +94,32 @@
         HtmlInputTextAjax comp = (HtmlInputTextAjax) component;
         String loadingStyleClass = AjaxRendererUtils.STYLECLASS_LOADER;
         //comp.setStyleClass(comp.getStyleClass() == null ? loadingStyleClass : comp.getStyleClass()
+ ";" + loadingStyleClass);
-        comp.setStyleClass(loadingStyleClass);
+        String styleClass = comp.getStyleClass();
+        if(styleClass != null && styleClass.length() > 0)
+        {
+            comp.setStyleClass(loadingStyleClass + " " + styleClass);
+        }
+        else
+        {
+            comp.setStyleClass(loadingStyleClass);
+        }
 
         if(!comp.getShowOkButton().booleanValue()){
             // then submit on change
             //comp.setOnchange(comp.getOnchange() == null ? submitFunctionStart : comp.getOnchange()
+ ";" + submitFunctionStart);
-            comp.setOnchange(submitFunctionStart);
+            String onchange = comp.getOnchange();
+            if(onchange != null && onchange.length() > 0) 
+            {
+                if(!onchange.endsWith(";")) 
+                {
+                    onchange += ";";
+                }
+                comp.setOnchange(submitFunctionStart+onchange);
+            } 
+            else 
+            {
+                comp.setOnchange(submitFunctionStart);
+            }
         }
         this.encodeJavascript(context, component);
         super.encodeEnd(context, component);



Mime
View raw message