Search code examples
gwtrequestfactorygwt-2.2

Delete a list of entity with RequestFactory (GWT)


How can I delete a list of entity with RequestFactory?

InstanceRequest<List<XProxy>, Void> remove();

Of course, this is not working, because the first parameter has to be like this: P extends BaseProxy; but is there a similar way?


I want to delete the selected entities of my CellTable from the database. And I am using MultiSelectionModel, and CheckboxCell.


Solution

  • An InstanceRequest means that the method is an instance method on the domain method for the first type argument (similar to looking for a remove() on a List in what you tried).

    You have to use a Request and pass the List as an argument to the method. The presence of a @ServiceLocator on the RequestContext will tell RequestFactory whether to look for a static or an instance method.

    Request<Void> remove(List<XProxy> list);