I am using datatable view with pagination and sorting to display a list. I am trying to add a checkbox to the datatable but I keep getting Runtime exception. Below is my code and I would greatly appreciate if someone can point out the problem:

Event.html
<form wicket:id="form">
        <table>
        <tr>
            <table class="dataview" cellspacing="0" wicket:id="table">[table]</table>
        </tr>
        </table>

Event.java
    public EventIndexPage() {
        add(new HeaderPanel("headerPanel"));
       
        IModel formModel = new CompoundPropertyModel(new EventDetachableModel(new Event()));
        FeedbackPanel feedback = new FeedbackPanel("feedback");
       
        add(new NewListForm(feedback, formModel));
        add(feedback);
        add(new EventNavigationBorder("eventNavigationBorder"));
        add(new EventNavigationPanel("eventNavigationPanel"));
    }
   
    private class NewListForm extends Form {
        public NewListForm(IFeedback feedback, IModel model) {
            super("form", model);
            final List columns = new ArrayList();
             // AbstractColumn implements IColumn
            columns.add(new AbstractColumn(new Model("Actions"))
            {
                public void populateItem(Item cellItem, String componentId, IModel model)
                {
                    cellItem.add(new ActionPanel(componentId, model, cellItem));
                }
            });

            columns.add(new PropertyColumn(new Model("Id"), "eventId", "eventId"));
            columns.add(new PropertyColumn(new Model("Event Description"), "description", "description"));
            columns.add(new PropertyColumn(new Model("Start Date"), "startDate", "startDate"));
            columns.add(new PropertyColumn(new Model("End Date"), "endDate"));
           
            add(new DefaultDataTable("table", columns, new EventSortableDataProvider(), 8));
           
            });
        }
    }
   
    class ActionPanel extends Panel
    {
        public ActionPanel(String id, final IModel model, final Item item)
        {
            super(id, model);
            add(new CheckBox("checkbox", item.getModel()));
        }
    }

}

Event$ActionPanel.html
<wicket:panel>
<td><input type="checkbox" wicked:id="checkbox" /></td>
</wicket:panel>

Thanks

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Reply via email to