Skip to Content
0
Former Member
Jun 29, 2009 at 11:49 AM

Binding Dynamic table with Dynamic node

44 Views

Hi, All

How to bind dynamic node to dynamic table????

i am using below code.using this table is filled with node data,but if 1st column is having 5 rows then 2nd column is displaying

values from 6 rows and first 5 rows r blank for that column.

can anybody tell what is a problem???

if( firstTime)

{

IWDTransparentContainer TableContainer = (IWDTransparentContainer)view.createElement(IWDTransparentContainer.class,"TC1");

IWDGridLayout TableLayout =(IWDGridLayout) TableContainer.createLayout(IWDGridLayout.class);

IWDTransparentContainer rootUIElementContainer= (IWDTransparentContainer)view.getElement("RootUIElementContainer");

rootUIElementContainer.addChild(TableContainer);

IWDTable my_table = (IWDTable)view.createElement(IWDTable.class,filename);

IWDNodeInfo nodeInfo= wdContext.getChildNode(filename,0).getNodeInfo();

my_table.bindDataSource(nodeInfo);

for (Iterator attributes = nodeInfo.iterateAttributes(); attributes.hasNext() ; )

{

IWDAttributeInfo attribute = (IWDAttributeInfo) attributes.next();

String attributeName = attribute.getName();

IWDTableColumn column = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);

IWDCaption caption =(IWDCaption)view.createElement(IWDCaption.class, null);

caption.setText(attributeName);

column.setHeader(caption);

my_table.addColumn(column);

IWDTextView editor = (IWDTextView) view.createElement(IWDTextView.class, null);

editor.bindText(nodeInfo.getAttribute(attributeName));

editor.setWrapping(true);

column.setTableCellEditor(editor);

}

TableContainer.addChild(my_table);

}