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] Created: (CLK-517) Controls using addLoadEvent does not work with Ajax
Date Thu, 02 Apr 2009 19:21:12 GMT
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