Skip to Content
0
Former Member
Feb 23, 2006 at 09:07 AM

Dynamic Node Creation

30 Views

Hai all,

I am new to the Dynpro. i have to create 'n' number of drop down at dynamically. The values of 'n' only known at runtime, that is fetch from database.

Basically each dropdown must have one node and one attribute. So i have to create 'n' number of nodes. Each drop down have different values.

I created some node at runtime using the following code.

for(int j=0;j<count;j++){

IWDNodeInfo node = wdContext.getNodeInfo

().addChild ("Roles"+j,null,true, true,false,

false,false,true,null,null,null);

node.addAttribute(roles[j].toString

(),"com.sap.dictionary.string");

}

This is done inside the wdDoInit() method.

Then i have to fetch the node one by one and load values from database and finally bind into the drop down inside the wdDoModifyView() method.

I tried the following code,but i don't know whether is it correct way or not.

if (firstTime) {

IWDTransparentContainer container =

(IWDTransparentContainer) view.getElement

("RootUIElementContainer");

container.createLayout(IWDMatrixLayout.class);

for(int rolecunt=0;rolecunt<size;rolecunt++){

IWDNode node = wdContext.currentContextElement().node().getChildNode("Roles"+rolecunt,rolecunt);

IWDNodeElement nodeElement1 = node.getCurrentElement();

}

}

thanks in advance,

Mukesh Mani.