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

 

 

 

你可能感兴趣的:(JavaScript,Ajax,wicket)