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
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
render as
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.ico">

but my modified style just renders as such:
<link wicket:id="style" rel="stylesheet" type="text/css"
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

Reply via email to