Thanks, your suggestion works like a charm.
I like the technique of using abstract method, you have a Swing development
background, right?
Thanks again.
Mathias P.W Nilsson wrote:
>
> I don't know if you can remove one row and just update the row as you can
> with TreeTable but maybe some here could guide you.
>
> If it is good enough to update the whole table then maybe somthing like
> this. this is typed from my head so there may be errors.
>
> public abstract DeleteContactPanel extends Panel{
> public DeleteContactPanel(String id, final Contact contact) {
> super(id);
> setOutputMarkupId(true);
> final Form form = new Form("form");
> form.add(new AjaxSubmitLink("delete") {
> @Override
> protected void onSubmit(AjaxRequestTarget target, Form form) {
> service.deleteContact(contact);
> onDelete( target );
> System.out.println("OK Deleted");
> }
> });
> add(form);
> }
> public abstract void onDelete( AjaxrequestTarget target );
> }
>
>
> final List<IColumn> columns = new ArrayList<IColumn>();
> columns.add(new AbstractColumn(new Model("Delete")) {
> public void populateItem(Item cellItem, String componentId, IModel
> rowModel) {
> Contact contact = ((Contact) rowModel.getObject());
> cellItem.add(new DeleteContactPanel(componentId, contact){
> public void onDelete( AjaxRequestTarget target ){
> // Add table here and show flashmessage
> info( "Row deleted" );
> target.addComponent( feedback );
> target.addComponent( datatable );
> }
> });
> }
> });
>
>
>
--
View this message in context:
http://www.nabble.com/How-to-remove-a-row-from-DataTable--tp23312849p23314945.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]