Re: [Wicket-user] Wicket manager resources inside Javascript and Css files

2007-04-17 Thread Paolo Di Tommaso

Guys, the problem is another, lets recap:

I've a folder with a javascript, a css and some images. From both the css
and the javascript I references these images using a relative path. For
example in the css url(the-image-1.gif) and in the javascript file image.src= '
the-image-2.gif'.

The css works fine instead the javascript image link is broke.

The problem is that a relative path in a CSS is relative to the location of
the css itself, so loading the css under the wicket
/resource/package.name.Class/ path it works fine.

BUT relative path in a javascript are relative to the page which loaded the
script NOT the script location, so the relative link will break!

Thanks, Paolo


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


On 4/16/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 in wicket 1.2.3 we do not allow default access to packaged resources
without
 explicitly adding a shared resource do we? i think that is the problem.
his
 css is a shared resource, but everything alongside it is not. so this
would
 for in 1.3 but not in 1.2.3.

Duh! Indeed. I completely forgot about that.

Eelco

-
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


Re: [Wicket-user] Wicket manager resources inside Javascript and Css files

2007-04-17 Thread Igor Vaynberg

then build the urls yourself and use packagedtexttemplate to preprocess the
javascript before you output it

we need better support for this, but its not there yet.

-igor


On 4/17/07, Paolo Di Tommaso [EMAIL PROTECTED] wrote:


Guys, the problem is another, lets recap:

I've a folder with a javascript, a css and some images. From both the css
and the javascript I references these images using a relative path. For
example in the css url( the-image-1.gif) and in the javascript file
image.src = 'the-image-2.gif'.

The css works fine instead the javascript image link is broke.

The problem is that a relative path in a CSS is relative to the location
of the css itself, so loading the css under the wicket
/resource/package.name.Class/ path it works fine.

BUT relative path in a javascript are relative to the page which loaded
the script NOT the script location, so the relative link will break!

Thanks, Paolo


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

 On 4/16/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
  in wicket 1.2.3 we do not allow default access to packaged resources
 without
  explicitly adding a shared resource do we? i think that is the
 problem. his
  css is a shared resource, but everything alongside it is not. so this
 would
  for in 1.3 but not in 1.2.3.

 Duh! Indeed. I completely forgot about that.

 Eelco

 -

 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


-
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


[Wicket-user] Wicket manager resources inside Javascript and Css files

2007-04-16 Thread Paolo Di Tommaso

Dear all,

which is the best strategy to use Wicket manager resource path from inside
Javascript file and Css?

For example I need to replace and url() attribute inside a css with a gif
deployed with the wicket application ..

Is there any example ?

Thanks in advance,
Paolo
-
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


Re: [Wicket-user] Wicket manager resources inside Javascript and Css files

2007-04-16 Thread Matej Knopp
If you the css is a packagedresource, you don't need to do anything
special. Just use relative url for the image and have the image in
same folder than css.

-
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


Re: [Wicket-user] Wicket manager resources inside Javascript and Css files

2007-04-16 Thread Matej Knopp
What do you mean in javascript file, can you make an example?

-Matej

On 4/16/07, Paolo Di Tommaso [EMAIL PROTECTED] wrote:
 Really .. I didn't know that. Great!

 But how to do with resource path in javascript file ?


 Thanks, Paolo


 On 4/16/07, Matej Knopp  [EMAIL PROTECTED] wrote:
 
  If you the css is a packagedresource, you don't need to do anything
  special. Just use relative url for the image and have the image in
  same folder than css.
 
 
 -
  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



-
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


Re: [Wicket-user] Wicket manager resources inside Javascript and Css files

2007-04-16 Thread Paolo Di Tommaso

Yes, for example in a JavaScript could be common to have something like
that:

document.getElementById('a-image-element').src =
'/path-to-image/resource.gif';

Anyway I've solved using in the JavaScript a CSS class, so reconducing the
the previous case.

Thanks Paolo


On 4/16/07, Matej Knopp [EMAIL PROTECTED] wrote:


What do you mean in javascript file, can you make an example?

-Matej

On 4/16/07, Paolo Di Tommaso [EMAIL PROTECTED] wrote:
 Really .. I didn't know that. Great!

 But how to do with resource path in javascript file ?


 Thanks, Paolo


 On 4/16/07, Matej Knopp  [EMAIL PROTECTED] wrote:
 
  If you the css is a packagedresource, you don't need to do anything
  special. Just use relative url for the image and have the image in
  same folder than css.
 
 

-
  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



-
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


Re: [Wicket-user] Wicket manager resources inside Javascript and Css files

2007-04-16 Thread Eelco Hillenius
 document.getElementById('a-image-element').src =
 '/path-to-image/resource.gif';

Also by relatively addressing those images. There are quite a few
components that do this (for instance wicket-datetime's DatePicker
component).

Eelco

-
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


Re: [Wicket-user] Wicket manager resources inside Javascript and Css files

2007-04-16 Thread Paolo Di Tommaso

Really ?! .. but in which version has been implemented.

I'm using Wicket 1.2.3 and adding a javascript using the following code:

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

Is not translating the path for relative resources ..


Thanks, Paolo



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


 document.getElementById('a-image-element').src =
 '/path-to-image/resource.gif';

Also by relatively addressing those images. There are quite a few
components that do this (for instance wicket-datetime's DatePicker
component).

Eelco

-
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


Re: [Wicket-user] Wicket manager resources inside Javascript and Css files

2007-04-16 Thread Igor Vaynberg

in wicket 1.2.3 we do not allow default access to packaged resources without
explicitly adding a shared resource do we? i think that is the problem. his
css is a shared resource, but everything alongside it is not. so this would
for in 1.3 but not in 1.2.3.

in 1.2.3 he has to manually add all the files to shared resources.

-igor


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


I guess I assumed to much then, and CSS really is the supported case.
It doesn't make much sense to me why CSS would and JavaScript wouldn't
work though. I haven't investigated this very deeply tbh. Maybe we
should create a test case or quick start for this and see what we can
do.

Eelco


On 4/16/07, Paolo Di Tommaso [EMAIL PROTECTED] wrote:
 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



-
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


Re: [Wicket-user] Wicket manager resources inside Javascript and Css files

2007-04-16 Thread Eelco Hillenius
On 4/16/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 in wicket 1.2.3 we do not allow default access to packaged resources without
 explicitly adding a shared resource do we? i think that is the problem. his
 css is a shared resource, but everything alongside it is not. so this would
 for in 1.3 but not in 1.2.3.

Duh! Indeed. I completely forgot about that.

Eelco

-
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