You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Balázs Palcsó (JIRA)" <ji...@apache.org> on 2014/03/17 12:00:44 UTC

[jira] [Comment Edited] (TAP5-2300) JavaScriptSupport.addInitializerCall is not backwards compatible

    [ https://issues.apache.org/jira/browse/TAP5-2300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13937663#comment-13937663 ] 

Balázs Palcsó edited comment on TAP5-2300 at 3/17/14 10:59 AM:
---------------------------------------------------------------

One manifestation of this issue is described here:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/5-4-beta3-JavaScript-backward-compatibility-issue-Tynamo-CKEditor-0-0-1-with-tapestry-5-4-beta3-doesk-tp5726129.html



was (Author: balapal):
One manifestation of issue is described here:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/5-4-beta3-JavaScript-backward-compatibility-issue-Tynamo-CKEditor-0-0-1-with-tapestry-5-4-beta3-doesk-tp5726129.html


> JavaScriptSupport.addInitializerCall is not backwards compatible
> ----------------------------------------------------------------
>
>                 Key: TAP5-2300
>                 URL: https://issues.apache.org/jira/browse/TAP5-2300
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.4
>            Reporter: Dragan Sahpaski
>         Attachments: TAP5-2300.patch
>
>
> In JavaScriptSupport, void addInitializerCall(String functionName, JSONArray parameter) and void addInitializerCall(InitializationPriority priority, String functionName, JSONArray parameter) are not backwards compatible with tapestry 5.3.
> Example:
> javaScriptSupport.addInitializerCall("Test1", new JSONObject("a", "b"));
> results with: Invoking t5/core/init("Test1", ["a","b"]), and it should result with: Invoking t5/core/init("Test1", "a", "b") according to the behavior in tapestry 5.3 also documented in the javadoc http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/services/javascript/JavaScriptSupport.html#addInitializerCall(org.apache.tapestry5.services.javascript.InitializationPriority, java.lang.String, org.apache.tapestry5.json.JSONArray). Quote "parameter - array of parameters to pass to the client-side function".
> The problem is with the way the code has been rewritten to use requirejs.
> Here's the bug https://github.com/apache/tapestry-5/blob/549b148f9af1bdd65c1e80b81c31274cfa4f8491/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/JavaScriptSupportImpl.java#L201
> parameter should be expanded when it's of type JSONArray.
> I'm attaching a patch with fixes for 2 failing test methods (after applying the patch) in JavaScriptSupportImplTest which are also wrong according to the behavior in 5.3.
> Please review.



--
This message was sent by Atlassian JIRA
(v6.2#6252)