struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Musachy Barroso (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (WW-1951) Ajax submit button executeScripts="true" evaluates javascript before DOM elements are defined
Date Sun, 03 Jun 2007 16:20:26 GMT

     [ https://issues.apache.org/struts/browse/WW-1951?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Musachy Barroso resolved WW-1951.
---------------------------------

    Resolution: Fixed

> Ajax submit button executeScripts="true" 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: Views
>    Affects Versions: 2.0.6
>            Reporter: Marshall Allen
>            Assignee: Musachy Barroso
>             Fix For: 2.1.0
>
>
> 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.


Mime
View raw message