You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Alberto José Rodríguez Rodríguez (JIRA)" <ji...@apache.org> on 2008/02/21 19:14:48 UTC

[jira] Created: (WW-2501) No JavaScript en sx:div

No JavaScript en sx:div
-----------------------

                 Key: WW-2501
                 URL: https://issues.apache.org/struts/browse/WW-2501
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - Dojo Tags
    Affects Versions: 2.1.0
            Reporter: Alberto José Rodríguez Rodríguez
            Priority: Critical


Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44344#action_44344 ] 

Jeromy Evans commented on WW-2501:
----------------------------------

Hi Johannes,

In your example:
  - does the sx:submit work in your ajax result work?
  - if you place a <script>window.alert("runs");</script> in your ajax result, does the alert pop up?

ie. I'm trying to isolate whether it's specific to the doubleselect or not. 

I haven't looked at the doubleselect scipt but it may be assuming the DOM is complete at the time it's executed 

> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44690#action_44690 ] 

Jeromy Evans commented on WW-2501:
----------------------------------

I concur contentPane.js and bind.js contain the bug identified by fanfrank

- if(djg.execScript)
+ if(this.executeScripts)

I'll attempt to patch, rebuild the custom profile and test

> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Johannes Geppert (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44399#action_44399 ] 

Johannes Geppert commented on WW-2501:
--------------------------------------

Hello Dave,

no the alert doesn't pop up.

Hi Jeromy,

i remove the sx:head and the s:head tags in my target, but it has no affect.
The javascript is already removed an the s:doubleselect does not work.



> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WW-2501) No JavaScript in sx:div

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeromy Evans resolved WW-2501.
------------------------------

    Resolution: Not A Problem
      Assignee: Jeromy Evans


I'm satisfied that there's no problem with the tags. It is quite easy for developers to write javascript that doesn't execute but this version of Dojo can't offer any further assistance in those cases. 

I have updated the documentation to clarify the causes:  
latest version: http://cwiki.apache.org/confluence/display/WW/Ajax+Tags

* inline scripts are ALWAYS removed from the response.  They MAY then be insert back again, independent of whether they are executed or not and this is browser dependent  *

case 1. executeScripts=true and separateScripts=true: valid javascript is executed and is not visible in the DOM. Code that makes assumptions on the scope of the "this" variable will not work, otherwise this combination works best.

case 2. executeScripts=true and separateScripts=false: valid javascript MAY be executed and MAY be visible in the DOM (browser dependent).  The code is correctly passed to the browser to be executed; the browsers often fail silently though (such as if its not valid for a <script> node to be created at the target position in the DOM).

case 3. executeScripts=false: javascript MAY be executed and MAY be visible in the DOM (browser dependent). MAY because IE sometimes executes scripts written to the DOM via innerHTML.  

The Dojo code is doing the best it can do under the situation. 

The operation for the parseContent attribute is completely independent of this issue.

The issues encountered with the doubleselect tag are the fault of the doubleselect tag's inline javascript.



> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Assignee: Jeromy Evans
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44398#action_44398 ] 

Jeromy Evans commented on WW-2501:
----------------------------------

Also, doesn't your target code mean you've nested two <sx:head> tags?
one at the top of the page and one in the fragment inserted into the page.  I'm sure that's not going to work.

The issue here is that browsers do not execute scripts inserted into a page via innerHTML (some do, some don't). If enabled, dojo parses your fragment, EXTRACT's the scripts, inserts the remaining HTML into the DOM and executes (eval's) the scripts. Hence, the inline scripts may not be visible in the DOM but may have been executed.

If you remove the nested head tags, is the alert shown?

There is potential for some inline scripts to not work in this scenario. eg. if it declares a function but doesn't add the function to the DOM.


> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44691#action_44691 ] 

Musachy Barroso commented on WW-2501:
-------------------------------------

Now that, is a nice catch, thanks for reporting guys. 

> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44265#action_44265 ] 

Musachy Barroso commented on WW-2501:
-------------------------------------

When the response is received, all the <script> tags are joined into one big script that is executed if executeScripts = true, the javascript content is removed from the html, I am not 100% sure why, but that how Dojo does it. Check showcase 2.1 in the ajax section and you will find examples of javascript running inside returned content. There is a good chance that you might have a javascript error in your scripts.

> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2501) No JavaScript in sx:div

Posted by "Alberto José Rodríguez Rodríguez (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alberto José Rodríguez Rodríguez updated WW-2501:
-------------------------------------------------

    Summary: No JavaScript in sx:div  (was: No JavaScript en sx:div)

> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44396#action_44396 ] 

Dave Newton commented on WW-2501:
---------------------------------

So the alert doesn't pop up?

> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Daniel Meyerholt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44015#action_44015 ] 

Daniel Meyerholt commented on WW-2501:
--------------------------------------

I am very interested in having this issue resolved. I don't have any workaround yet and I really cannot understand why struts2.1.2 is released as beta containing this grave bug. 

> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44692#action_44692 ] 

Jeromy Evans commented on WW-2501:
----------------------------------

Actually, i'm wrong.

The objective of the djg.execScript line is to detect whether the execScipt() function exists. This function only exists in IE, so it checks for it and invokes it only when present.

If the function doesn't exist, dojo creates a <script> node, adds the code to it and adds the node to the DOM. It doesn't explitly call eval as far as I can tell; it relies on the brower eval'ing the script.

This means there is in fact no bug here.  Thoughts?    more on struts-dev.



> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WW-2501) No JavaScript en sx:div

Posted by "Alberto José Rodríguez Rodríguez (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43334#action_43334 ] 

aj2r edited comment on WW-2501 at 2/22/08 12:19 AM:
--------------------------------------------------------------------------------

removed

      was (Author: aj2r):
    struts_dojo.js.uncompressed.js
....
17893 // exec in global, lose the _container_ feature
17894 var djg = dojo.global();
17895 if(djg.execScript){
17896 djg.execScript(code);
17897 }else{
17898 var djd = dojo.doc();
17899 var sc = djd.createElement("script");
17900 sc.appendChild(djd.createTextNode(code));
17901 (this.containerNode||this.domNode).appendChild(sc);
17902 }
...

At line 17901 in struts_dojo.js.uncompressed.js and at line 11213 in struts_dojo.js I found a mistake. It appends child sc, but sc is undeclared, sc will be replaced for code
  
> No JavaScript en sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Johannes Geppert (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44053#action_44053 ] 

Johannes Geppert commented on WW-2501:
--------------------------------------

I have the same problem, also with the possible option parseContent="true" doesn't seem to solve the problem. 


> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Johannes Geppert (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44474#action_44474 ] 

Johannes Geppert commented on WW-2501:
--------------------------------------

Today i do some experiments.

1.) I try to submit my formular with <sx:a> , but this has no affect, the scripts are not running

2.) I try the yui Plugin, but it didn't work for me.

3.) I try to submit with plain  jquery, that works, all scripts are executed, in FF3 i have some trouble to select entry's in the s:doubleselect with the mouse (In IE6 it works perfectly). 

Is dojo the problem?

> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript en sx:div

Posted by "Alberto José Rodríguez Rodríguez (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43334#action_43334 ] 

Alberto José Rodríguez Rodríguez commented on WW-2501:
------------------------------------------------------

struts_dojo.js.uncompressed.js
....
17893 // exec in global, lose the _container_ feature
17894 var djg = dojo.global();
17895 if(djg.execScript){
17896 djg.execScript(code);
17897 }else{
17898 var djd = dojo.doc();
17899 var sc = djd.createElement("script");
17900 sc.appendChild(djd.createTextNode(code));
17901 (this.containerNode||this.domNode).appendChild(sc);
17902 }
...

At line 17901 I found a mistake. It appends child sc, but sc is undeclared, sc will be replaced for code

> No JavaScript en sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2501) No JavaScript in sx:div

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown updated WW-2501:
--------------------------

    Fix Version/s: 2.1.3

> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Daniel Meyerholt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44582#action_44582 ] 

Daniel Meyerholt commented on WW-2501:
--------------------------------------

hi!
 thanks fanfrank for pointing out that solution.
I noticed that my problematic stuff (non-struts-dojo-tags) is getting evaluated only if <sx:head /> defines the attribute parseContent: 
<sx:head parseContent="true" />



> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WW-2501) No JavaScript en sx:div

Posted by "Alberto José Rodríguez Rodríguez (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43334#action_43334 ] 

aj2r edited comment on WW-2501 at 2/22/08 12:18 AM:
--------------------------------------------------------------------------------

struts_dojo.js.uncompressed.js
....
17893 // exec in global, lose the _container_ feature
17894 var djg = dojo.global();
17895 if(djg.execScript){
17896 djg.execScript(code);
17897 }else{
17898 var djd = dojo.doc();
17899 var sc = djd.createElement("script");
17900 sc.appendChild(djd.createTextNode(code));
17901 (this.containerNode||this.domNode).appendChild(sc);
17902 }
...

At line 17901 in struts_dojo.js.uncompressed.js and at line 11213 in struts_dojo.js I found a mistake. It appends child sc, but sc is undeclared, sc will be replaced for code

      was (Author: aj2r):
    struts_dojo.js.uncompressed.js
....
17893 // exec in global, lose the _container_ feature
17894 var djg = dojo.global();
17895 if(djg.execScript){
17896 djg.execScript(code);
17897 }else{
17898 var djd = dojo.doc();
17899 var sc = djd.createElement("script");
17900 sc.appendChild(djd.createTextNode(code));
17901 (this.containerNode||this.domNode).appendChild(sc);
17902 }
...

At line 17901 I found a mistake. It appends child sc, but sc is undeclared, sc will be replaced for code
  
> No JavaScript en sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "fanfrank (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44510#action_44510 ] 

fanfrank commented on WW-2501:
------------------------------

to sole this problem temporarily ,follow these steps:
1) change file "struts_dojo.js.uncompressed.js" in struts2-dojo-plugin-2.1.2.jar
line 17895: if(djg.execScript)   => if(this.executeScripts)

2) use div tag like this:
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
... ...
<sx:div id="publish" label="xxxx" href="/xxxx.jsp" separateScripts="false" executeScripts="true"/>
... ...
note: "separateScripts" is set to false and executeScripts is set to true

3) in xxx.jsp,the form must include the "name" attribute, for example:
<s:form id="editForm" name="editForm" action="addjob" namespace="/corp" >
              <s:doubleselect
	tooltip="Choose Your State"
	 label="State"
	name="region" list="{'North', 'South'}"
	value="'South'"
	doubleValue="'Florida'"
	doubleList="top == 'North' ? {'Oregon', 'Washington'} : {'Texas', 'Florida'}" 
	doubleName="state"
	headerKey="-1"
	headerValue="---------- Please Select ----------"
	emptyOption="true" />
<s:form>

done!



> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WW-2501) No JavaScript in sx:div

Posted by "Daniel Meyerholt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44582#action_44582 ] 

dxm edited comment on WW-2501 at 9/1/08 3:02 PM:
--------------------------------------------------------------

hi!
 thanks fanfrank for pointing out that solution.
I noticed that my problematic stuff (non-struts-dojo-tags) is getting evaluated only if <sx:head /> defines the attribute parseContent: 
<sx:head parseContent="true" />

But this also applies to nested <sx:div> tags in a <sx:tabbedpane>

      was (Author: dxm):
    hi!
 thanks fanfrank for pointing out that solution.
I noticed that my problematic stuff (non-struts-dojo-tags) is getting evaluated only if <sx:head /> defines the attribute parseContent: 
<sx:head parseContent="true" />


  
> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Johannes Geppert (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44342#action_44342 ] 

Johannes Geppert commented on WW-2501:
--------------------------------------

no with current 2.1.2 it does not work. I give you an Example.

I have following div

	<sx:div id="ziel">
	....
	</sx:div>

with this Form i call an Action thats load an other form into "ziel"

	<s:form action="transport" theme="xhtml">
		<s:textfield cssStyle="width: 170px;" id="auftrag" label="Auftrag" maxlength="20" name="auftrag" 		 required="true" accesskey="a"/>
<s:radio id="art" label="Transportart" list="#{'t':'Test','p':'Produktiv'}" name="art" required="true" accesskey="t"/>
		<sx:submit value="wählen" targets="ziel" highlightColor="blue" highlightDuration="2000" indicator="indicator" executeScripts="true" separateScripts="true" parseContent="true"/>
	</s:form>


thats work an I see following form in my target
	<s:form action="zusammenfassung" theme="xhtml">
		<s:doubleselect 
			name="thema" 
			label="Meine Themen" 
			list="meinethemen" 
			listKey="id" 
			listValue="name" 
			emptyOption="true" 
			headerValue="-1" 
			cssStyle="width: 170px;"
 
			doubleName="aufgabe"
			doubleList="aufgabes" 
			doubleListKey="id" 
			doubleListValue="name" 
			doubleEmptyOption="true"
			doubleHeaderKey="-1"
			doubleCssStyle="width: 170px;"
		/>
		<sx:submit value="Absenden" targets="zusammen" highlightColor="blue" highlightDuration="2000" indicator="indicator2" executeScripts="true" separateScripts="true"/>
	</s:form>


The Problem is, the doubleselect does not work. I use the tags 
<s:head/>
<sx:head/>

in the main page and also in the target page thats load into my target "ziel".

When I put the Doubleselect in my Mainpage withouit AJAX Call it works great.

I hope my code can help you to explain the Problem.






> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Haaken Stark (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43915#action_43915 ] 

Haaken Stark commented on WW-2501:
----------------------------------

This issues causes all javascripts generated by Struts or included in the remote page to be removed when the page is loaded through an sx:div tag. Toogling with the possible options with 'executeScripts' and 'separateScripts' doesn't seem to solve the problem. 

So when for example a s:form is set to validate="true" in the remote content, the included scripts is unable to execute. Or if an s:optiontransferselect tag is used in the remote content, which uses several javascript files like 'struts/util.jsp' and 'struts/optiontransferselect.js' and some aditional scripts generated by Struts, none of this scripts are able to execute.

Further, when executeScripts="false" and separateScripts="false" is set, I can see that the javascripts are included, but unable to run., by inspecting the html using Firebug in Firefox. But when the attributes are set to executeScripts="true" and separateScripts="true", no scripts are executed and included. An error message is displayed instead: ' DEBUG: Error running scripts from content: undefined'.

Any workaround or updates on this issue?

> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WW-2501) No JavaScript in sx:div

Posted by "fanfrank (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44510#action_44510 ] 

frankfxg edited comment on WW-2501 at 8/1/08 5:52 AM:
------------------------------------------------------

to sole this problem temporarily ,follow these steps:
1) change file "struts_dojo.js.uncompressed.js" in struts2-dojo-plugin-2.1.2.jar
line 17895: if(djg.execScript)   => if(this.executeScripts)
if use compressed script, you must change the file "struts_dojo.js" in struts2-dojo-plugin-2.1.2.jar too

2) use div tag like this:
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
... ...
<sx:div id="publish" label="xxxx" href="/xxxx.jsp" separateScripts="false" executeScripts="true"/>
... ...
note: "separateScripts" is set to false and executeScripts is set to true

3) in xxx.jsp,the form must include the "name" attribute, for example:
<s:form id="editForm" name="editForm" action="addjob" namespace="/corp" >
              <s:doubleselect
	tooltip="Choose Your State"
	 label="State"
	name="region" list="{'North', 'South'}"
	value="'South'"
	doubleValue="'Florida'"
	doubleList="top == 'North' ? {'Oregon', 'Washington'} : {'Texas', 'Florida'}" 
	doubleName="state"
	headerKey="-1"
	headerValue="---------- Please Select ----------"
	emptyOption="true" />
<s:form>

done!



      was (Author: frankfxg):
    to sole this problem temporarily ,follow these steps:
1) change file "struts_dojo.js.uncompressed.js" in struts2-dojo-plugin-2.1.2.jar
line 17895: if(djg.execScript)   => if(this.executeScripts)

2) use div tag like this:
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
... ...
<sx:div id="publish" label="xxxx" href="/xxxx.jsp" separateScripts="false" executeScripts="true"/>
... ...
note: "separateScripts" is set to false and executeScripts is set to true

3) in xxx.jsp,the form must include the "name" attribute, for example:
<s:form id="editForm" name="editForm" action="addjob" namespace="/corp" >
              <s:doubleselect
	tooltip="Choose Your State"
	 label="State"
	name="region" list="{'North', 'South'}"
	value="'South'"
	doubleValue="'Florida'"
	doubleList="top == 'North' ? {'Oregon', 'Washington'} : {'Texas', 'Florida'}" 
	doubleName="state"
	headerKey="-1"
	headerValue="---------- Please Select ----------"
	emptyOption="true" />
<s:form>

done!


  
> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2501) No JavaScript in sx:div

Posted by "Johannes Geppert (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44395#action_44395 ] 

Johannes Geppert commented on WW-2501:
--------------------------------------

Hi Jeromy,

I try to add you script but this is removed in the result.

This is the code of my submit button
<sx:submit value="Absenden" targets="zusammen" highlightColor="blue" highlightDuration="2000" indicator="indicator2" executeScripts="true" separateScripts="true"/> 

this is the sample code in my taret jsp page
<s:head/>
<sx:head/>
<!-- begin test -->
<script>window.alert("runs");</script>
<!-- end test -->

the result is this
<!-- begin test -->

<!-- end test -->

The sx:submit button in my ajax result works fine and call a new ajax action in an differnt target.

Only my own javascript and the javascript from s:doubleselect was removed. 


> No JavaScript in sx:div
> -----------------------
>
>                 Key: WW-2501
>                 URL: https://issues.apache.org/struts/browse/WW-2501
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.1.0
>            Reporter: Alberto José Rodríguez Rodríguez
>            Priority: Critical
>             Fix For: 2.1.3
>
>
> Time ago I noticed that javascript were removed in the pages linked by <sx:div ..>.
> Parameters executeScripts and separateScripts don't solve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.