You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by bj�rn liffers <ba...@arcor.de> on 2010/02/15 09:51:11 UTC

wicket and javascript

hello,
i tried to generate a.js-file, but i wasn´t able to generate it in the folder where i wanted it to be.
so i decided to generate it from a StringModel but it still didn´t work.

i have several scripts that are implemented via resource...
like this one:
     add(JavascriptPackageResource.getHeaderContribution(Start.class, "js/raphael-min.js"));

the StringModel was added after the script-ressource
     add(JavascriptPackageResource.getHeaderContribution(Start.class, "js/raphael-min.js"));
     add(new Label("rScript", Model.of(rScript)).setEscapeModelStrings(false));

but when the page rendered the StringModel was implemented before the ressources where added.

i dislike to place the StringModel´s script-tag in the body-tag instead of the head-tag of my html-file
is there any possibility to solve that?
if it´s not possible to do it this way, is there anyone who can tell me how to get the absolute path to my Start.class dynamically?
would be glad to get answers to both questions :)

in my company there isn´t anyone dealing with wicket, it´s some kind of explorative task for me

thank you
*exceptionist*

Immer auf dem Laufenden! Sport, Auto, Reise, Politik und Promis. Von uns für Sie: der neue Arcor.de-Newsletter!
Jetzt anmelden und einfach alles wissen: http://www.arcor.de/rd/footer.newsletter

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket and javascript

Posted by exceptionist <ba...@arcor.de>.

jthomerson wrote:
> 
> If you're rendering JS that shouldn't be executed until the page is
> loaded,
> call this method in your renderHead method:
> 
> http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/IHeaderResponse.html#renderOnDomReadyJavascript%28java.lang.String%29
> 
> --
> Jeremy Thomerson
> http://www.wickettraining.com
> 

GREAT!!!! the script is still above the others, but i don´t care as long as
it works :) and the whole js-part is in the page´s head-tag :)

thx 4 your help :)
-- 
View this message in context: http://old.nabble.com/wicket-and-javascript-tp27590908p27621035.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket and javascript

Posted by JonnyL <zo...@ozemail.com.au>.
I have a JS file that has a function to return a node value from an XML file.
The JS file is referenced in the head section of the page and the function
is called from the page body. The JS function runs but does not return the
XML node. How do I reference the XML file?

Hope you can help



jthomerson wrote:
> 
> If you're rendering JS that shouldn't be executed until the page is
> loaded,
> call this method in your renderHead method:
> 
> http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/IHeaderResponse.html#renderOnDomReadyJavascript%28java.lang.String%29
> 
> --
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> 
> 
> On Tue, Feb 16, 2010 at 8:12 AM, exceptionist <ba...@arcor.de> wrote:
> 
>>
>>
>>
>> igor.vaynberg wrote:
>> >
>> > allow your component to implement IHeaderContributor and output both
>> > your base js and string js from the renderhread() method
>> > -igor
>> >
>>
>> du u have a code-example(link oder something like that) for this way of
>> solving my prob?
>> i tried several times to do it, but i always got the same result...
>> the script, which was generated dynamically was rendered into the head
>> before the ressource-implementation, instead of behind that block of
>> code.
>> --
>> View this message in context:
>> http://old.nabble.com/wicket-and-javascript-tp27590908p27608918.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/wicket-and-javascript-tp27590908p27950990.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket and javascript

Posted by Jeremy Thomerson <je...@wickettraining.com>.
If you're rendering JS that shouldn't be executed until the page is loaded,
call this method in your renderHead method:

http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/IHeaderResponse.html#renderOnDomReadyJavascript%28java.lang.String%29

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Feb 16, 2010 at 8:12 AM, exceptionist <ba...@arcor.de> wrote:

>
>
>
> igor.vaynberg wrote:
> >
> > allow your component to implement IHeaderContributor and output both
> > your base js and string js from the renderhread() method
> > -igor
> >
>
> du u have a code-example(link oder something like that) for this way of
> solving my prob?
> i tried several times to do it, but i always got the same result...
> the script, which was generated dynamically was rendered into the head
> before the ressource-implementation, instead of behind that block of code.
> --
> View this message in context:
> http://old.nabble.com/wicket-and-javascript-tp27590908p27608918.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: wicket and javascript

Posted by exceptionist <ba...@arcor.de>.


igor.vaynberg wrote:
> 
> allow your component to implement IHeaderContributor and output both
> your base js and string js from the renderhread() method
> -igor
> 

du u have a code-example(link oder something like that) for this way of
solving my prob?
i tried several times to do it, but i always got the same result...
the script, which was generated dynamically was rendered into the head
before the ressource-implementation, instead of behind that block of code.
-- 
View this message in context: http://old.nabble.com/wicket-and-javascript-tp27590908p27608918.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket and javascript

Posted by Igor Vaynberg <ig...@gmail.com>.
allow your component to implement IHeaderContributor and output both
your base js and string js from the renderhread() method

-igor

2010/2/15 björn liffers <ba...@arcor.de>:
> hello,
> i tried to generate a.js-file, but i wasn´t able to generate it in the folder where i wanted it to be.
> so i decided to generate it from a StringModel but it still didn´t work.
>
> i have several scripts that are implemented via resource...
> like this one:
>     add(JavascriptPackageResource.getHeaderContribution(Start.class, "js/raphael-min.js"));
>
> the StringModel was added after the script-ressource
>     add(JavascriptPackageResource.getHeaderContribution(Start.class, "js/raphael-min.js"));
>     add(new Label("rScript", Model.of(rScript)).setEscapeModelStrings(false));
>
> but when the page rendered the StringModel was implemented before the ressources where added.
>
> i dislike to place the StringModel´s script-tag in the body-tag instead of the head-tag of my html-file
> is there any possibility to solve that?
> if it´s not possible to do it this way, is there anyone who can tell me how to get the absolute path to my Start.class dynamically?
> would be glad to get answers to both questions :)
>
> in my company there isn´t anyone dealing with wicket, it´s some kind of explorative task for me
>
> thank you
> *exceptionist*
>
> Immer auf dem Laufenden! Sport, Auto, Reise, Politik und Promis. Von uns für Sie: der neue Arcor.de-Newsletter!
> Jetzt anmelden und einfach alles wissen: http://www.arcor.de/rd/footer.newsletter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org