[
https://issues.apache.org/struts/browse/WW-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40277
]
Musachy Barroso commented on WW-1755:
-------------------------------------
BindDiv and Bind are not related. It does seem to be a problem, but it comes
from Dojo directly, if you add this to a page:
<div
dojoType="ContentPane"
id="dojo"
href="/struts2-showcase/AjaxTest.action"
>
Initial Content</div>
and then (I was using FireBug):
var widget = dojo.widget.byId("dojo");
widget.addOnLoad(function (){alert("refresh!");});
widget.refresh();
then the "refresh!" message pops as expected. If you do (again):
widget.refresh();
then nothing happens. Looking at: widget._onLoadStack (the list of callback
functions), I see that the list has the callback function before the request,
and it is empty after. My take on this is that because the content of the div
is reloaded, the widget somehow is reinitialized, loosing that list. I'm not
sure if this can be fixed, if you have any ideas, let me know.
> dojo binddiv fails to load onLoad functions on refresh.
> -------------------------------------------------------
>
> Key: WW-1755
> URL: https://issues.apache.org/struts/browse/WW-1755
> Project: Struts 2
> Issue Type: Bug
> Components: Misc
> Affects Versions: 2.0.5
> Environment: N/A
> Reporter: Thaddeus Foudray
> Assigned To: Musachy Barroso
>
> The binddiv (extending the dojo ContentPane widget) has a method called
> "onLoad" that triggers events after the entire div has been loaded
> completely. This allows functions to be added that do things to the loaded
> content. (added via "addOnLoad", also in ContentPane).
> In the BindDiv implementation, the first load of the page properly runs the
> onLoad function, and correctly triggers any functions there. However, the
> refresh function ( reloadContents) does not call onLoad. The superclass
> (ContentPane) does call onLoad in _downloadExternalContent(), which is called
> by the contentPane's refresh function, so it seems like that behavior should
> be duplicated in the binddiv widget.
> After a quick look, the reloadContents exists in bind.js, and the handler
> (Line ~225) is what should be calling the inLoad (to mirror what the
> ContentPane does), although I haven't tested this theory at all.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.