Struts 2
  1. Struts 2
  2. WW-3015

dojo will not run javascript in ajax result if the result includes includes sx:submit

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 2.1.6
    • Fix Version/s: None
    • Component/s: Plugin - Dojo Tags
    • Labels:
      None
    • Environment:

      Fedora Core 10, 2.6.27.12-170.2.5.fc10.i686
      apache-tomcat-6.0.18

      Description

      ------------test-ajax.jsp--------------------------------------
      <%@ taglib prefix="s" uri="/struts-tags" %>
      <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

      <html>
      <head>
      <s:head />
      <sx:head parseContent="true" debug="true"/>
      </head>

      <body>
      <s:url action="test-ajaxresult" id="testAjaxURL"/>
      <sx:div id="testDiv" href="%

      {testAjaxURL}

      " executeScripts="true"/>
      </body>
      </html>
      --------------------------------------------------------------------

      ----------------test-ajaxresult.jsp--------------------------------
      <%@ taglib prefix="s" uri="/struts-tags" %>
      <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

      <script type="text/javascript">
      alert("foo");
      </script>

      <p>Here is some text</p>

      <p>This sx:submit button will cause dojo not to run the javascript above. Remove it or change it to a plain s:submit and the script executes:</p>
      <p><sx:submit href="/someurl" targets="testDiv"/></p>
      -------------------------------------------------------------------------

      The error I get from dojo in debug mode is just "DEBUG: Error running scripts from content: undefined"

      This bug seems to make it impossible to populate a div with a form that includes javascript

        Activity

        Hide
        musachy added a comment -

        Resolving as "Won't fix". If you have a patch for this issue, please attach it and re-open it.

        Show
        musachy added a comment - Resolving as "Won't fix". If you have a patch for this issue, please attach it and re-open it.
        Hide
        Ryan Grice added a comment -

        Including sx:head in the ajax result makes this work properly.

        Can close this

        Show
        Ryan Grice added a comment - Including sx:head in the ajax result makes this work properly. Can close this
        Hide
        Ryan Grice added a comment -

        update: looks like it doesnt even matter if the content is loaded from an sx:div. This breaks too, unless you remove the sx:submit from test-ajaxresult.jsp:

        ----------------test-ajax.jsp-----------------------
        <%@ taglib prefix="s" uri="/struts-tags" %>
        <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

        <html>
        <head>
        <s:head />
        <sx:head parseContent="true" debug="true"/>
        </head>

        <body>
        <div id="testDiv">
        <sx:submit href="/test-ajaxresult.action" targets="testDiv" executeScripts="true"/>
        </div>
        </body>
        </html>
        -----------------------------------------------------

        Show
        Ryan Grice added a comment - update: looks like it doesnt even matter if the content is loaded from an sx:div. This breaks too, unless you remove the sx:submit from test-ajaxresult.jsp: ---------------- test-ajax.jsp ----------------------- <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sx" uri="/struts-dojo-tags" %> <html> <head> <s:head /> <sx:head parseContent="true" debug="true"/> </head> <body> <div id="testDiv"> <sx:submit href="/test-ajaxresult.action" targets="testDiv" executeScripts="true"/> </div> </body> </html> -----------------------------------------------------

          People

          • Assignee:
            Unassigned
            Reporter:
            Ryan Grice
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development