Quantcast

populateItem(Item<ICellPopulator<>>) - example

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

populateItem(Item<ICellPopulator<>>) - example

Charles Moulliard
Hi,

I try to create in a table a column which will contain a link to execute an action (install something, uninstall something). I have created a ListArray containing the list of columns to be displayed :

List<IColumn<ExtendedFeature>> columns = new ArrayList<IColumn<ExtendedFeature>>();

This list is added to a DefaultDataTable<ExtendedFeature>("features", columns, new FeaturesProvider(model), 20));

The columns are defined like that for the static :

        columns.add(new PropertyColumn<ExtendedFeature>(new StringResourceModel("table.state", this, state), "state", "state"));
        columns.add(new PropertyColumn<ExtendedFeature>(new StringResourceModel("table.version", this, version), "version", "version"));


But I block to setup the "Dynamic" Column containing the action Install or Uninstall (depending on a state of my model). From IRC channel, Martin G. tells me to add a column overriding this

org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator.populateItem(Item<ICellPopulator<T>>, String, IModel<T>)

and add a Panel with any content

Can someone points me to an example as documentation of Wicket does not implements this ?

Regards,

Charles
Loading...