May be overriding of onComponentTagBody will do your trick:

public class TextLink extends Link {

  public TextLink(String id, IModel model) {
    super(id, model);
  }

  @Override
  protected void onComponentTagBody(final MarkupStream markupStream,
final ComponentTag openTag) {
    if (getModelObject()==null) {
      replaceComponentTagBody(markupStream, openTag, "");
    } else {
      replaceComponentTagBody(markupStream, openTag,
getModelObject().toString());
    }
  }
}

On Wed, Oct 7, 2009 at 12:28 PM, Richard Nichols <[email protected]> 
wrote:
> Is there a way to have it added by wicket (see orig. msg)?
>
> The requirement or content of the <span> might change if the CSS style
> changes. I'd like to encapsulate that logic as a wicket component if
> possible.
>
> 2009/10/7 Jeremy Thomerson <[email protected]>:
>> Just add the span to your markup in your *.html file.
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>> On Tue, Oct 6, 2009 at 11:20 PM, Richard Nichols <[email protected]> wrote:
>>
>>> Hi everyone, I'm a new Wicket user and I have (what I hope is) a
>>> simple question -
>>> I have a SubmitLink -
>>>
>>> <a href="#" wicket:id="login">Login</a>
>>> ...
>>> add(new SubmitLink("login"));
>>>
>>> I want to change the rendered content of the <a></a> tag such that it is -
>>>
>>> <a href="#" wicket:id="login" onClick= ... (all the regular wicket
>>> stuff) ...><span>Login</span></a>
>>>
>>> i.e. just wrap the raw content of the <a> tag with <span>. This is to
>>> support CSS link styling. Because the CSS requirements might change
>>> over time, I'd like wicket to add this markup, rather than putting it
>>> in the HTML.
>>>
>>> I've tried to figure out how to do this from the examples and the
>>> wicket source, but I feel like I'm missing something obvious...
>>>
>>> cheers,
>>> Richard.
>>>
>>> --
>>> Richard Nichols :: http://www.visural.com/ ::
>>> http://www.richardnichols.net/
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>
>
>
>
> --
> Richard Nichols :: http://www.visural.com/ :: http://www.richardnichols.net/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to