Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

wicket DefaultDataTable  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a wicket DefaultDataTable showing my data. Now i need to edit every rows. How can i do this ??
Thank you very much.

Here my code :

ListSortableDataProvider provider = new ListSortableDataProvider(){
public void refresh(List list) {

List<LinkPropertyColumn> columns = Arrays.asList(
new LinkPropertyColumn(new Model("Codice"), null, "tpCode"),
new LinkPropertyColumn(new Model("Descrizione"), null, "tpName"),
new LinkPropertyColumn(new Model("Codice Gruppo"), null, "tpGrpCode"),
new LinkPropertyColumn(new Model("Descrizione Gruppo"), null, "tpGrpName")

final DefaultDataTable ajaxTable = new DefaultDataTable("RequestTable", columns, provider, 20);
ajaxTable.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(10)){
protected void onPostProcessTarget(AjaxRequestTarget target) {
And the inner class :
class LinkPropertyColumn extends PropertyColumn {

PopupSettings popupSettings;
IModel labelModel;

public LinkPropertyColumn(IModel displayModel, String sortProperty,
String propertyExpression, PopupSettings popupSettings) {
this(displayModel, sortProperty, propertyExpression);
this.popupSettings = popupSettings;

public LinkPropertyColumn(IModel displayModel, IModel labelModel) {
super(displayModel, null);
this.labelModel = labelModel;

public LinkPropertyColumn(IModel displayModel, String sortProperty,
String propertyExpression) {
super(displayModel, sortProperty, propertyExpression);

public LinkPropertyColumn(IModel displayModel, String propertyExpressions) {
super(displayModel, propertyExpressions);

public void populateItem(Item item, String componentId, IModel model) {
item.add(new LinkPanel(item, componentId, model));

public void onClick(Item item, String componentId, IModel model) {

public class LinkPanel extends Panel {

public LinkPanel(final Item item, final String componentId,
final IModel model) {

Link link = new Link("link") {

public void onClick() {
LinkPropertyColumn.this.onClick(item, componentId, model);



IModel tmpLabelModel = labelModel;

if (labelModel == null) {
tmpLabelModel = createLabelModel(model);
link.add(new Label("label", tmpLabelModel));
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!