Anything similar for spitting something out _after_ the tag that the component is mapped to? e.g. Sending out some text/html after a checkbox?
Presumably onComponentTagBody doesn't get called because it is not a Container and the input tag is send after anything I do in onComponentTag :( Al Maw wrote: > > Sam Hough wrote: >> Lots of the time I just want a link with text as the body of the ... ... >> >> The Link class takes an IModel so presumably uses that for something but >> I >> can't see it in the source or get it to appear... >> >> Sorry I'm being thick and I did search honest! > > You'd typically use the model so you have something to get at in the > onClick(). > > Of course, if you don't care about how much state is in your session, > you can just make whatever it is final so you can use it in there anyway. > > If you want to use the model for the text of the link instead, then you > could write a class like this: > > > public abstract class TextLink extends Link { > public TextLink(String id, IModel model) { > super(id, model); > } > > protected void onComponentTagBody(final MarkupStream markupStream, > final ComponentTag openTag) > { > replaceComponentTagBody( > markupStream, openTag, getModelObjectAsString() > ); > } > > } > > > If you want enabled/disabled to work properly, you'll need to copy the > relevant bits out of AbstractLink#onComponentTagBody(...) > > > Regards, > > Al > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Link-text-tf4751114.html#a13624806 Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]