executeScripts="true" on an ajax submit button evaluates javascript before DOM 
elements are defined
---------------------------------------------------------------------------------------------------

                 Key: WW-1951
                 URL: https://issues.apache.org/struts/browse/WW-1951
             Project: Struts 2
          Issue Type: Bug
          Components: API
    Affects Versions: 2.0.6
            Reporter: Marshall Allen


If you have an ajax submit button that replaces the div specified by the 
targets attribute with the result from an action as below;

<div id="someDiv"></div>
<ww:submit value="Submit" href="%{someUrl}" theme="ajax" 
showLoadingText="false"  targets="someDiv" executeScripts="true"/>

and the result returned by the action has some javascript to be executed that 
uses the document.getElementById() method as below;

<ww:textfield id="someField" name="someField"/>
<script type="text/javascript">
var element = document.getElementById('someField');
alert(element);
</script>

then, the variable "element" will be equal to null. It seems like the 
javascript is being executed before the <ww:textfield/> is available/defined in 
the DOM.

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

Reply via email to