Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

best model for editing a list of items in a table?

$
0
0
I have my own WidgetManager interface, and I want to edit a list of
widgets in a table. I create an IDataProvider<Widget>:

final IDataProvider<Widget> widgetProvider = new
ListDataProvider<Widget>() {
@Override
protected List<Widget> getData() {
return widgetManager.getWidgets());

};

Then I populate my table like so:

final DataView<Widget> widgetDataView = new
DataView<Widget>("widget", widgetProvider) {
@Override
protected void populateItem(final Item<Widget> item) {

The problem is when one of the buttons in a widget table row uses the
WidgetManager to delete a Widget. yet the table doesn't get updated in
that request.

What's the appropriate way to populate a table so that a button in the
table can delete one of the items backing the row of a table? Should I
be using a ListView with a LoadableDetachableModel instead? See
http://stackoverflow.com/questions/4353732/wicket-listview-not-refreshing .

Thanks,

Garret

Viewing all articles
Browse latest Browse all 5648

Trending Articles