Let your component implement IHeaderContributor and add the line of
javascript in the renderHeader method

regards
Michael


Sarkast wrote:
> 
> Hello everyone,
> 
> I have a small problem. I have a wicket component and the idea is that the
> programmer can add numerous messages to it and whenever the component is
> rendered (is added to a requesttarget probably) some javascript is
> executed to iterate over the messages and displays them.
> 
> I thought that I could simply override onBeforeRender(), or
> onAfterRender(), but I simply can't figure out how to append javascript.
> Basically I just want to have a line of javascript executed, like
> "messagebox.displayMessage('asdasdasd')". 
> 
> Before someone asks why I just don't add a label with the message, the
> messagebox is dragable, fades after a while and should display messages
> for a set amount of time (before the next message is displayed) and should
> also be used on client side without requests.
> 
> Any thoughts? Help would be appreciated.
> 
> The last resort would be to give the requesttarget to the component and
> append javascript directly, but that seems more complicated then
> necessary.
> 
> Tom
> 


-----
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/Javascript-in-onBeforeRender-tp18868357p18869581.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to