This is very strange because I've all files (css, js, and images) all in the
same path.

From the CSS I'm referencing two images using the url(..) attribute with a
relative path. This works fine.

From the JS I'm referencing another image in the same path of the
javascript, so using a:

image.src = 'relative-image.jpg'


But in this case the image is broke, looking at the server log I can see
that the image path is not translated under the wicket 'resource/...' path.

Both the css and js are added in the same way ..

add( new StyleSheetReference("sortable_css", new ResourceReference(
WorkflowListPage.class,"sortable/sortabletable.css")));

add( new JavaScriptReference("sortable_js", new ResourceReference(
WorkflowListPage.class,"sortable/sortabletable.js")));



Thanks, Paolo



On 4/16/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:

> Really ?! .. but in which version has been implemented.
>
> I'm using Wicket 1.2.3 and adding a javascript using the following code:

That's a very old version. But look at the datepicker in extensions
for that project, as that uses relative images from JavaScript.

> add( new JavaScriptReference("sortable_js", new
> ResourceReference(getClass(),"sortable/sortabletable.js")))

Be *very* careful using getClass() there. Are you sure the actual
class isn't a subclass of the class you really want? Try to use
MyClass.class in resource references.

> Is not translating the path for relative resources ..

If your javascript file is served from /resources/... then everything
that is declared relatively should go through that as weell.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to