On 11/14/06, Carfield Yim <[EMAIL PROTECTED]> wrote:
> Look like it is more easier to show a sortable and pagable table than
> using DataView. However if I need to show more than property from an
> object. Like a BookmarkablePageLink , How should I do? Look like I
> need to extended a custom AbstractColumn. Where can I find samples of
> doing that?
>
Just get another issue about having custom cell at DataTable.

If I just like to format the output, it is can be done using custom
AbstractColumn like

    private static class WhenClosedColumn extends AbstractColumn {
        public WhenClosedColumn() {
            super(new Model("WhenClosed"), "WhenClosed");
        }
        public void populateItem(Item cellItem, String componentId,
IModel model) {
            final Order order = (Order) model.getObject(cellItem);
            cellItem.add(new Label(componentId,
Formatter.format(order.getWhenClosed())));
        }
    }

However, if I like to display a link, I will not work if I just add a
BookmarkableLink like


    private static class OrderIdColumn extends AbstractColumn {
        public OrderIdColumn() {
            super(new Model("OrderId"), "OrderId");
        }

        private static final long serialVersionUID = 1L;

        public void populateItem(Item cellItem, String componentId,
IModel model) {
            final Order order = (Order) model.getObject(cellItem);
            final Map<String, String> map = new HashMap<String, String>();
            map.put("orderid", order.getOrderId().toString());
            cellItem.add(new BookmarkablePageLink(componentId,
Edit.class, new PageParameters(map)));
        }
    }

It just display a text call "[cell]". How can I solve this?

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to