I've done similar things by creating a model that wraps another model.
 The outer model modifies the content of the inner model's string by
adding markup, converting links, etc...  This is really very effective
because you can actually separate the logic into multiple models if
you would like to...  And you could create your own MultiLineLabel
that automatically adds these models.

Tutorial on nested models:
http://www.jeremythomerson.com/blog/2008/11/06/wicket-the-power-of-nested-models/

For instance, you could nest multiple implementations like this:

public class OurCustomMultiLineLabel extends MultiLineLabel {

  public OurCustomMultiLineLabel(String id, IModel<String> model) {
    super(id);
    IModel<String> ourModel = new ConvertLinksModel(model);
    ourModel = new AddColorsModel(ourModel);
    setModel(ourModel);
    setEscapeModelStrings(false);
  }
}

--
Jeremy Thomerson
http://www.wickettraining.com




On Tue, May 12, 2009 at 6:00 AM,  <wolfgang.sch...@dachser.com> wrote:
>
> Hi,
>
> I have a request to put a link into a MultiLineLabel, or to set
> some Words within the MultiLineLabel with a different color.
>
> Is this possible in general?
>
> thx
> - jk
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to