Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

dynamic table building

In my Layout I created a Table (with no columns) and set the Datasource to a context Node (with no elements).

The columns and elements are build dynamically, or so I want to.

Here are some code snippets of my source to show how am doing this.

to add the context node elements:

IWDNodeInfo debDataNode;
debDataNode = wdContext.getNodeInfo().getChild("debData");
...
debDataNode.addAttribute(colName, "ddic:com.sap.dictionary.string");

to add columns to the table:

IWDTable theTable;
IWDTableColumn aColumn;
IWDCaption aCaption;
IWDTextView aCell;
theTable = (IWDTable) view.getElement("debTable");
...
aColumn = (IWDTableColumn) view.createElement
   (IWDTableColumn.class, colName);
aCaption = (IWDCaption) view.createElement
   (IWDCaption.class, captionName);
aCell = (IWDTextView) view.createElement
   (IDWTextView.class, cellName);
aColumn.setHeader(aCaption);
aColumn.setTableCellEditor(aCell);
theTable.addColumn(aColumn);

to set the context values:

debDataNode = wdContext.nodeDebData();
debDataElement = debDataNode.createElement();
debDataElement.setAttributeValue("col2", "col2");
debDataNode.addElement(debDataElement);

The rows are perfectly created in the table, but the values are not displayed. What am I missing?

Former Member
Not what you were looking for? View more on this topic or Ask a question