click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Schellink (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (CLK-517) Controls using addLoadEvent does not work with Ajax
Date Wed, 27 May 2009 17:29:46 GMT

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

Bob Schellink resolved CLK-517.
-------------------------------

    Resolution: Fixed

fixed in trunk as part of JsScript implementation. For Ajax requests the "addLoadEvent" won't
be rendered (Ajax requests doesn't trigger the DOM loaded event), instead the JavaScript payload
will be evaluated immediately.

> Controls using addLoadEvent does not work with Ajax
> ---------------------------------------------------
>
>                 Key: CLK-517
>                 URL: https://issues.apache.org/jira/browse/CLK-517
>             Project: Click
>          Issue Type: Improvement
>          Components: core, extras
>            Reporter: Bob Schellink
>            Assignee: Bob Schellink
>             Fix For: 2.1.0
>
>
> When loading a page with Ajax, control callbacks registered with addLoadEvent won't fire
because the DOM ready event has already occurred.
> One solution is to expose the following method on ClickUtils:
> public static JsScript createAddLoadEvent() {
>     JsScript script = new JsScript() {
>         public void renderContent(HtmlStringBuffer buffer) {
>             if (getContext().isAjaxRequest()) {
>                 buffer.append("if (typeof(Click) != 'undefined')");
>                 buffer.append("    if (typeof(Click.domready) != 'undefined')");
>                 buffer.append("Click.domready.ready = true;");
>             }
>             super.renderContent(buffer);
>         }
>     }
> }

-- 
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