cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic addition of a column to a table

Former Member
0 Kudos

Hi All,

I need to add one column dynamically to the existing table and also I have to populate the data dynamically. Can you help me out in this? Thanks in advance.

Message was edited by:

Bharath Akuthota

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Either create it a design-time invisible and make it visible if needed (probably more simply than by code), or use some code like this:

wdDoModifyView(...)
{
  if (<table structure changed>)
  {
    IWDTable table = (IWDTable) view.getElement("TableID");
    IWDTableColumn col = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
    table.addColumn(col); // NW04
    table.addGroupedColumn(col); // NW 7.0
    IWDInputField editor = (IWDInputField) view.createElement(IWDInputField.class, null);
    col.setTableCellEditor(editor);
    editor.bindValue(<attribute inside table data source that should be edited>);
  }
}

Armin

Answers (0)