Perhaps a subclass of AbstractColumn?

public class MessageFormatColumn<T> extends AbstractColumn<T>
{
  private final String pattern;

  public MessageFormatColumn(IModel<String> displayModel, String pattern)
  {
    super(displayModel);
    this.pattern = pattern;
  }

  public void populateItem(Item<ICellPopulator<T>> cellItem, String
componentId, IModel<T> model)
  {
    cellItem.add(new Label(componentId, MessageFormat.format(pattern,
model.getObject())));
  }
}

This would work for dates, numbers, etc.  You just have to know how to
specify the format pattern.

p.s. Warning, this code is off the top of my head, so it might not
work "out of the box", but it gives you the idea.

On Sat, Feb 14, 2009 at 2:32 PM, Christoph GrĂ¼n <chris...@gmx.at> wrote:
> Hi all,
>
>
>
> columns.add(new PropertyColumn(new Model<String>("Title"), "title", " title
> "));
>
>
>
> How can I have such a  property column that displays java.util.dates?
>
> I would also need the same for checkboxes or true/false values.
>
>
>
> Thanks a lot,
>
> Christoph
>
>
>
>

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

Reply via email to