Re: AttributeModifier & relative path rendering in conflict
HeaderContributor is the answer. add( CSSPackageResource.getHeaderContribution( "css/" + style.getName() + "/promo.css" ) ); The javadocs explicitly state that a css location that does not begin will a leading / (slash) will be have it's relative path prepended to it. http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/CSSPackageResource.html Thank you for the help! --pete
Re: AttributeModifier & relative path rendering in conflict
Ah, thank you. I will look into using HeaderContributor instead. I have a good feeling that will take care of my problem. I will post back my findings this afternoon. --pete
Re: AttributeModifier & relative path rendering in conflict
May help: http://javathoughts.capesugarbird.com/2007/08/branding-wicket-application-take-2.html On Tue, Sep 29, 2009 at 2:03 AM, pete swulius wrote: > All, > > I am trying to use an AttributeModifier to change the stylesheet used on a > Page of mine. > > WebComponent styleComponent = new WebComponent( "style" ); > styleComponent.add( new SimpleAttributeModifier( "href", "css/" + > style.getName() + "/stylesheet.css" ) ); > add( styleComponent ); > > The different stylesheets are located in sub-directories corresponding to > style.getName(). The problem I have is that whatever code prepends all > relative paths on the rendered page is not applying it to this 'modified > attribute'. For instance: > > I see this > > render as > > > but my modified style just renders as such: > href="css/foobar/stylesheet.css"/> > > Obviously this relative path swipe happens before the attributes are > modified. Is there a better way to do what I'm trying to do? Thank you! > > --pete > -- Pedro Henrique Oliveira dos Santos
AttributeModifier & relative path rendering in conflict
All, I am trying to use an AttributeModifier to change the stylesheet used on a Page of mine. WebComponent styleComponent = new WebComponent( "style" ); styleComponent.add( new SimpleAttributeModifier( "href", "css/" + style.getName() + "/stylesheet.css" ) ); add( styleComponent ); The different stylesheets are located in sub-directories corresponding to style.getName(). The problem I have is that whatever code prepends all relative paths on the rendered page is not applying it to this 'modified attribute'. For instance: I see this render as but my modified style just renders as such: Obviously this relative path swipe happens before the attributes are modified. Is there a better way to do what I'm trying to do? Thank you! --pete