Monday, November 5, 2007, 12:16:50 PM, Sam wrote:
SH> Lots of the time I just want a link with text as the body of the
SH> ... ... The Link class takes an IModel so presumably uses that for
SH> something but I can't see it in the source or get it to appear...
It's typically just used so the model object's available if you want
to pass arguments to the destination - see the javadoc.
For what I think you're after, you'd need to have something like
<a wicket:id="link" href="#"><span wicket:id="linkTitle">Link</span></a>
then do
Link link = new Link("link") {
public void onClick() {
// ToDo: Implement this!
}
};
Label label = new Label("linkTitle"); // or new Label("linkTitle", <model>);
link.add(label);
add(link);
or similar, e.g.
add(
new Link("link") {
public void onClick() {
// ToDo: Implement this!
}
}.add(new Label("linkTitle")));
if you prefer!
--
/Gwyn
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]