Hi,
when working with Wicket models, you should always call #getObject() or
#getModelObject() as late as possible:
ListView<ImagesGroup> imagesGroupsListView = new
ListView<ImagesGroup>("imagesGroupsListView", imagesGroupsModel) {
@Override
@Transactional
protected void populateItem(final ListItem<ImagesGroup> listItem) {
AjaxLink<String> deleteImagesGroup = new
AjaxLink<String>("deleteImagesGroup") {
@Override
public void onClick(AjaxRequestTarget target) {
// access model object as late as possible
imagesGroupService.deleteImagesGroup(listItem.getModelObject());
// force reload
imagesGroupsModel.detach();
target.add(imagesGroupsForm);
}
};
listItem.add(deleteImagesGroup);
}
};
Can you spot the difference?
Sven
On 02/24/2013 08:12 AM, meduolis wrote:
This does not solves the issue.
Heres my code:
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Loadable-non-detachable-list-model-for-listView-tp4656216p4656727.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org