myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1621880 - in /myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html: HtmlJavaScriptUtils.java HtmlRendererUtils.java
Date Mon, 01 Sep 2014 20:36:27 GMT
Author: lu4242
Date: Mon Sep  1 20:36:26 2014
New Revision: 1621880

URL: http://svn.apache.org/r1621880
Log:
MYFACES-3919 javax.faces.SEPARATOR_CHAR Applied Incorrectly to commandLink Hidden Field (Thanks
to Bill Lucy for provide this patch)

Modified:
    myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java
    myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java?rev=1621880&r1=1621879&r2=1621880&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java
Mon Sep  1 20:36:26 2014
@@ -129,8 +129,9 @@ public final class HtmlJavaScriptUtils
     private static void prepareScript(FacesContext facesContext,
             ScriptContext context, boolean autoScroll)
     {
-
-        final char separatorChar = facesContext.getNamingContainerSeparatorChar();
+        // MYFACES-3919 remember idcl separator char is special and always should be ':',
+        // because it should be hardcoded into the js file.
+        final char idclSeparatorChar = ':';
         context.prettyLine();
 
         //render a function to create a hidden input, if it doesn't exist
@@ -274,7 +275,7 @@ public final class HtmlJavaScriptUtils
         context.prettyLine();
 
         context.append(SET_HIDDEN_INPUT_FN_NAME);
-        context.append("(formName,formName +'" + separatorChar + "'+'"
+        context.append("(formName,formName +'" + idclSeparatorChar + "'+'"
                 + HtmlRendererUtils.HIDDEN_COMMANDLINK_FIELD_NAME
                 + "',linkId);");
 
@@ -327,7 +328,7 @@ public final class HtmlJavaScriptUtils
         context.prettyLine();
 
         context.append(CLEAR_HIDDEN_INPUT_FN_NAME);
-        context.append("(formName,formName +'" + separatorChar + "'+'"
+        context.append("(formName,formName +'" + idclSeparatorChar + "'+'"
                 + HtmlRendererUtils.HIDDEN_COMMANDLINK_FIELD_NAME
                 + "',linkId);");
 

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java?rev=1621880&r1=1621879&r2=1621880&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
Mon Sep  1 20:36:26 2014
@@ -1547,8 +1547,8 @@ public final class HtmlRendererUtils
         {
             return HIDDEN_COMMANDLINK_FIELD_NAME_TRINIDAD;
         }
-        return formInfo.getFormName() + FacesContext.getCurrentInstance().getNamingContainerSeparatorChar()
-            + HIDDEN_COMMANDLINK_FIELD_NAME;
+        return formInfo.getFormName() + ':' 
+                + HIDDEN_COMMANDLINK_FIELD_NAME;
     }
     
     public static String getHiddenCommandLinkFieldName(
@@ -1558,7 +1558,7 @@ public final class HtmlRendererUtils
         {
             return HIDDEN_COMMANDLINK_FIELD_NAME_TRINIDAD;
         }
-        return formInfo.getFormName() + FacesContext.getCurrentInstance().getNamingContainerSeparatorChar()
+        return formInfo.getFormName() + ':'
                 + HIDDEN_COMMANDLINK_FIELD_NAME;
     }
 
@@ -1592,7 +1592,7 @@ public final class HtmlRendererUtils
     public static String getHiddenCommandLinkFieldNameMyfacesOld(
             FormInfo formInfo)
     {
-        return formInfo.getFormName() + FacesContext.getCurrentInstance().getNamingContainerSeparatorChar()
+        return formInfo.getFormName() + ':'
                 + HIDDEN_COMMANDLINK_FIELD_NAME_MYFACES_OLD;
     }
 
@@ -2785,4 +2785,4 @@ public final class HtmlRendererUtils
             super(buf, prettyPrint);
         }
     }
-}
\ No newline at end of file
+}



Mime
View raw message