[ 
https://issues.apache.org/jira/browse/WICKET-2206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12695851#action_12695851
 ] 

Johan Compagner commented on WICKET-2206:
-----------------------------------------

hmm dont know if we want such a very simple thing in core
And i dont get why a onload call back to the server is really needed
What do you exactly do there? Checking if the page is expired? But that would 
be very unlikely when you just have loaded the page.

> OnLoadAjaxBehavior
> ------------------
>
>                 Key: WICKET-2206
>                 URL: https://issues.apache.org/jira/browse/WICKET-2206
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4-RC2
>            Reporter: Juha Paananen
>             Fix For: 1.5-M1
>
>
> It would be convenient to have an OnLoadAjaxBehavior that can be used to 
> execute server side code when page is loaded. For instance, I'm using this to 
> check if the page has expired (the related user workflow has already 
> finished). In short, here's the code:
> public abstract class OnLoadAjaxBehavior extends AbstractDefaultAjaxBehavior {
>     private static final long serialVersionUID = 1L;
>     @Override
>     public void renderHead(final IHeaderResponse response) {
>         StringBuilder javascript = new StringBuilder();
>         javascript.append("wicketAjaxGet('" + getCallbackUrl() + "', 
> function() {}, function() { });\n");
>         response.renderOnLoadJavascript(javascript.toString());
>     }
> }
> This leaves the respond(..) method abstract. The concrete classes will add 
> the server behavior in their implementations of the respond(..) method.
> For me it took several hours to find out how to do this relatively simple 
> thing. If we had this behavior class in Wicket, it would save some time for 
> other n00bs.

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