Okay, thank you, this works.
Nevertheless putting
getParent().getParent().getModel().detach();
to link handler doesn't seem very pretty.
Maybe like I'll just stick with Redirect to render. :)
-Matej
Johan Compagner wrote:
detach youre model first.
Because a model in redirect_to_buffer isn't loaded twice because all is
done in one request.
customersModel.detach() should do the trick
or remove the deleted customer specific from that model
johan
Matej Knopp wrote:
Hi.
For a long time I was working with render strategy set to
REDIRECT_TO_RENDER. Now I've switched to REDIRECT_TO_BUFFER and found
out, that removing items from ListViews no longer works.
I've code like
IModel customersModel = new LoadableDetachableModel() {
protected Object load() {
return CustomerDAO.getAllCustomers();
}
};
add (new ListView("customers", customersModel) {
protected void populateItem(ListItem item) {
Customer customer = (Customer) item.getModelObject();
...
item.add(new Link("delete") {
public void onClick() {
Customer customer = (Customer)
getParent().getModelObject();
CustomerDAO.delete(customer);
}
});
}
});
The problem is, that after deleting a cutomer, the list is not updated
until page refresh (the model doesn't get reloaded and list refreshed).
What's the recommended solution to this?
Thanks.
-Matej
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing
& QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user