Hi, You can use org.apache.wicket.request.UrlRenderer#renderRelativeUrl(Url) to render relative url to your special resource. As a parameter use org.apache.wicket.request.UrlRenderer#getBaseUrl() which should return the current page's url.
On Mon, Jun 4, 2012 at 10:08 AM, Dirk Forchel <dirk.forc...@exedio.com> wrote: > Hi, > we have to use PIE (see http://css3pie.com/ http://css3pie.com/ ) to make > IE7 and IE8 capable of rendering CSS3 decoration features. We use a shared > resource mount to have an absolute URL in our CSS file (see also > https://issues.apache.org/jira/browse/WICKET-3046 > https://issues.apache.org/jira/browse/WICKET-3046 ). > > > > This works fine. > But CSS3 allows web designers to specify multiple background images for box > elements, using nothing more than a simple comma-separated list. This works > for e.g. Firefox and IE9 but not for IE7 and IE8. Therefore we want to us > the PIE behavior and the /-pie-background/ attribute. > > *There are two main issues related to relative paths in CSS:* > > *The beahvior URL* > > IE interprets the URL for the behavior property relative to the source HTML > document, rather than relative to the CSS file like every other CSS > property. This makes invoking the PIE behavior inconvenient, because the URL > has to either be: > 1. absolute from the domain root (this makes the CSS not easily moveable > between directories) or > 2. realtive to the HTML document (this makes the CSS not easily reusable > between different HTML files) > We went for the first solution as our CSS is "global" for the application. > > *URLs in PIE-interpreted CSS properties* > > PIE does not parse the CSS stylesheets, it lets IE handle the parsing, > selector querying, cascading, etc. and then simply asks it for the resulting > property values. This means that when PIE gets a property value, it has no > knowledge of the context from which that value originated. > As a result, for properties which contain URL values (such as border-image > or -pie-background), PIE cannot resolve those URLs relative to the CSS file > in which they appear. > > The PIE documentation says: /"It resolves them instead relative to the > JavaScript execution context, which is the location of the source HTML > document."/. > But as far as I know, in Wicket the image URLs within a CSS resource are > interpreted relative to the resource. And this seems to be our problem > finding image resources. > > > I fiddled around with this problem a whole day but got no proper solution > (It's not a solution for us to put the CSS file and the images in the web > root container). > Does anybody have a solution for our problem? > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/CSS3-PIE-behavior-and-image-resources-tp4649699.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org