Skip to Content
0
Former Member
Oct 17, 2009 at 07:15 PM

WDRuntimeException: DataSource attribute of table not valid

27 Views

Hi,

I wrote a web dynpro java application.

I created node programatically, and i created table programatically again.

When i bind node to table it gets error below

Thanks.

Error

WDRuntimeException: DataSource attribute of table not valid

My code is below

Code

Creating node

IWDNodeInfo rootNodeInfo = wdContext.getNodeInfo();

IWDNodeInfo DNode =

rootNodeInfo.addChild("DNode", null, true, false, true, false, false, true, null, null, null);

DNode.addAttribute(

"BLM",

"ddic:com.sap.dictionary.string");

DNode.addAttribute(

"PER",

"ddic:com.sap.dictionary.string");

IWDNode node = wdContext.getChildNode("DNode", 0);

IWDNodeElement element = node.createElement();

element.setAttributeValue("BLM", "qwerty");

element.setAttributeValue("PER", "cvbcvbcvb");

node.addElement(element);

Binding to a table

IWDNodeInfo DNode = wdContext.getNodeInfo().getChild("DNode");

IWDTransparentContainer rootElement =

(IWDTransparentContainer) view.getRootElement();

IWDTable DTablo =

(IWDTable) view.createElement(IWDTable.class, "DTablo");

DTablo.bindDataSource(DNode); //error here

IWDTableColumn col1 =

(IWDTableColumn) view.createElement(

IWDTableColumn.class,

"BLM");

IWDTextView txtw1 =

(IWDTextView) view.createElement(IWDTextView.class, "BLMTX");

txtw1.bindText("DNode.BLM");

IWDTableCellEditor cled1 = txtw1;

col1.setTableCellEditor(cled1);

DTablo.addColumn(col1);

DTablo.setVisibleRowCount(20);

rootElement.addChild(DTablo);