ITeye博客

Wicket forum tips

x98zero · 2008-07-24 17:16 · wicket · Markdown

How do I call my javascript after each wicket partial update?

 

if you want to execute a certain piece of js code after *every* (successful)
ajax update,
you can use the following js code:
wicketGlobalPostCallHandler = function {
  alert('successful partial update');
}

as "wicket user" already said, you can also add javascript in serverside
code
using AjaxRequestTarget#appendJavascript or #prependJavascript.

and there's still the option to use an IAjaxCallDecorator.

----------------------------------------------------------------------------------------------------------------------------

 

IHeaderContributor (Wicket 1.3.2 API)

<noscript></noscript>

public interface IHeaderContributor
extends IClusterable

An interface to be implemented by components or behaviors that wish to
contribute to the header section of the page. Example:

 class MyPanel extends Panel implements IHeaderContributor
 {
        public MyPanel(String id)
        {
                super(id);
        }
 
        public void renderHead(IHeaderResponse response)
        {
                response.renderOnLoadJavascript("alert('page loaded!');");
        }
 }

 

------------------------------------------------------------------------------------------------------------------------

Post or Get Request

return

 e"POST".equals(((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest().getMethod());

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。