Re: Dynamic javascript generation

2010-03-22 Thread Sigmar Muuga
But I got my problem solved with response.renderJavascript("
second", "firstUniqueID");

AbstractBehaviour didnt help me out...

Thanks!


On Mon, Mar 22, 2010 at 8:54 AM, Sigmar Muuga  wrote:

> It cannot be done like this, I got the error:
>
> WicketMessage: Cannot modify component hierarchy after render phase has 
> started (page version cant change then anymore)
>
>
>
> On Sun, Mar 21, 2010 at 10:38 PM, Stefan Lindner wrote:
>
>> Add them in the needed order
>>
>>response.renderJavascript("first", "firstUniqueID");
>>response.renderJavascript("second", "firstUniqueID");
>>
>> -Ursprüngliche Nachricht-
>> Von: Sigmar Muuga [mailto:meedi...@gmail.com]
>> Gesendet: Sonntag, 21. März 2010 21:36
>> An: users@wicket.apache.org
>> Betreff: Re: Dynamic javascript generation
>>
>> My  tags are all in specific order, so how can I put this script
>> right after some certain script tag there?
>>
>> Sigmar
>>
>> On Sun, Mar 21, 2010 at 10:31 PM, Stefan Lindner > >wrote:
>>
>> > Ok, try this
>> >
>> >add(new AbstractBehavior() {
>> >@Override
>> >public void renderHead(IHeaderResponse response)
>> {
>> >super.renderHead(response);
>> >response.renderJavascript("> dynamically
>> > generated JS>", "");
>> >}
>> >}
>> >);
>> >
>> > Every time the component (to that the AbstractBehaivor is added) is
>> redrawn
>> > (eg. Initally or after an AjaxUpodate) the dynamically generated
>> javascript
>> > is renderedinto .
>> > If you want to make sure that it is not rendered twice from another
>> > component with thie AbstractBehavior, just add some "uniqueID" in the
>> > renderJavascript call.
>> >
>> >
>> >
>> > -Ursprüngliche Nachricht-
>> > Von: Sigmar Muuga [mailto:meedi...@gmail.com]
>> > Gesendet: Sonntag, 21. März 2010 21:22
>> > An: users@wicket.apache.org
>> > Betreff: Re: Dynamic javascript generation
>> >
>> > I need to include this dynamic js in my header with