`
x98zero
  • 浏览: 107513 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Wicket forum tips

阅读更多

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());

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics