---
title: "Wicket forum tips"
author: "x98zero"
date: "2008-07-24T17:16:12Z"
tags: []
slug: "wicket-forum-tips"
draft: false
lastmod: "2008-07-24T17:16:12Z"
id: 219158
url: "https://x98zero.iteye.com/blog/219158"
---

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)

&lt;noscript&gt;&lt;/noscript&gt;

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