dear community,

still working on a reimplementation of a former jsf gui i have some more
questions about how to implement it correctly in wicket;

* simple components:
in my html i have many lines where i need just little modifications of the
html:

e.g. in jsf i had 10 lines like: <link rel="stylesheet" type="text/css"
href="#{mediaPath.cssFolder}/header.css" />  (mediaPath is dynamic)
in wicket this will be 10 lines with: <link wicket:id="headerCssLink"
rel="stylesheet" type="text/css" href="header.css" /> and 10 components
added to the page, like: add( new HrefChanger( "headerCssLink",
LINKTYPE_CSS) );
the HrefChanger-Component just takes the tag from the html and changes the
href attribute by prepending the css-path;

is this the correct way?

seems that sth like the wicket:link tag would be right for this - can i
write my own wicket:cssLink tag or can i somehow extend the behaviour of the
wicket:link tag?

* changing html content for inline styles or javascript:
in jsf i had this dynamic inline style definition: <style> a{color:
${linkcolor}; } </style>
in wicket i tried: <style> a{color: <span wicket:id="linkColor"/>; }</style>

and in the page: add( new Label("linkColor",
getLinkColor()).setRenderBodyOnly(true);

but the span does not get parsed, wicket says: "...you have added a
component in code but forgot to reference it in the markup..."; same when i
want to replace something in a javascript function, e.g.  alert( 'Hello
<span wicket:id="userName" !'/>

whats the right way to do this?


thx in advance, uwe!

Reply via email to