What about a texttemplate? For the js?

I wrote something about it here:

http://ninomartinez.wordpress.com/2008/09/09/apache-wicket-javascript-integration/

But it might be overkill.

Ittay Dror wrote:

Martijn Dashorst wrote:
I'm sure I don't understand your question, but in a futile attempt to
answer it anyway:

thanks for the effort ;)

my point is that the javascript file is also generated. e.g., the code in it
creates javascript objects that are attached to the html elements in the
containing page. of course, i can attach behaviors to those components that
will render the javascript inline the page, but it seems to me this will be
harder to read  (if the javascript objects interact with each other) and so
maintain.


<html>
<head>
<wicket:link>
<script src="FooPage.js"></script>
</wicket:link>
</head>
<body>
</body>
</html>

Martijn

On Mon, Oct 27, 2008 at 4:03 PM, Ittay Dror <[EMAIL PROTECTED]> wrote:

Michael Sparer wrote:
take a look at headercontributors e.g.
http://chillenious.wordpress.com/2006/05/03/wicket-header-contributions-with-behaviors/

This will only generate the reference to the javascript in the html page.
However, now when the browser tries to request this javascript file, I
want
the request to go to the same Page object that created the html, so that
it
renders the javascript file.

Assume FooPage.java. A request FooPage.html creates a call to FooPage. It
then contributes FooPage.js to the header and then I want a request to
FooPage.js to go back to FooPage so it creates the javascript file by
using
the same hierarchy of components.

Ittay





regards,
Michael


Ittay Dror wrote:
Hi,

I'd like to create a page with lots of javascript code. For reasons of
maintenance, I'd like the Page object to generate the html with
reference
to a javascript file with the same name and .js extension so when the
browser tries to load this file the same Page object then renders (by
using behaviors) the javascript content. (by saying 'object renders' I
mean the normal wicket style rendering of delegating to the contained
component hierarchies).

Any pointers would be appreciated.

Ittay

--
View this message in context:
http://www.nabble.com/generate-javascript-file-together-with-html-page-tp20188258p20189490.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]



--
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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





--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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

Reply via email to