You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Loritsch, Berin C." <Be...@gd-ais.com> on 2009/11/20 19:22:54 UTC
Resolving image locations
I'm using the Wicket Image object, and I'm having a hard time ensuring
that it resolves properly.
I have a base class to set up the UI template for the site, including
the logo image. I added a new page in a child package, and as a result
the Image declared in the base class is resolving relative to the new
class. This is counter-intuitive, and violates the expectations of
object oriented programming. Here is the basic situation:
package.SiteTemplate
--------------------
Declares Image(Logo)
package.images.Logo
-------------------
Contains the image
package.subsystem.NewPage
-------------------------
Uses logo declared in SiteTemplate,
But browser can't find it
What I want to do is tell Wicket to always provide one path for the Logo
image, so I don't have to duplicate the logo in several packages. I
attempted to hardcode the path in plain HTML, but that URL broke as soon
as the IDE put the app in a context. I'd like Wicket to take care of
the base path, but not treat it like a resource that needs to be
internationalized. How do I do that?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: Resolving image locations
Posted by "Loritsch, Berin C." <Be...@gd-ais.com>.
Never mind. The problem was using Image instead of ContextImage. I
guess that's the danger of relying on type-ahead to suggest the right
thing.
-----Original Message-----
From: Loritsch, Berin C. [mailto:Berin.Loritsch@gd-ais.com]
Sent: Friday, November 20, 2009 1:23 PM
To: users@wicket.apache.org
Subject: Resolving image locations
I'm using the Wicket Image object, and I'm having a hard time ensuring
that it resolves properly.
I have a base class to set up the UI template for the site, including
the logo image. I added a new page in a child package, and as a result
the Image declared in the base class is resolving relative to the new
class. This is counter-intuitive, and violates the expectations of
object oriented programming. Here is the basic situation:
package.SiteTemplate
--------------------
Declares Image(Logo)
package.images.Logo
-------------------
Contains the image
package.subsystem.NewPage
-------------------------
Uses logo declared in SiteTemplate,
But browser can't find it
What I want to do is tell Wicket to always provide one path for the Logo
image, so I don't have to duplicate the logo in several packages. I
attempted to hardcode the path in plain HTML, but that URL broke as soon
as the IDE put the app in a context. I'd like Wicket to take care of
the base path, but not treat it like a resource that needs to be
internationalized. How do I do that?
---------------------------------------------------------------------
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