cancel
Showing results for 
Search instead for 
Did you mean: 

How to add columns in table at runtime?

Former Member
0 Kudos

Hi all,

I have a table in which 4 columns are fixed.. As per the the selection of a number by the user in the previous View some more columns should be added to this table

How am i to achieve this.

Points assured for help

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
wdDoModifyView(...)
{
  if (<columns-should-be-added>)
  {
    IWDTable table = (IWDTable) view.getElement("tableID");
    IWDTableColumn column = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
    IWDTextView editor = (IWDTextView) view.createElement(IWDTextView.class, null);
    editor.bindText(<some context attribute under table data source node>);
    column.setTableCellEditor(editor);
    table.addColumn(column);
    <reset flag that columns should be added>;
  }
}

This code is for NW04. In NW04s, use the GroupedColumn aggregation for adding columns.

Armin

Answers (0)