cancel
Showing results for 
Search instead for 
Did you mean: 

Populate Values for Drop Down by Index in Table in Web Dynpro Java

Former Member
0 Kudos

Hi Experts,

I have a table and having a column table cell editor as Drop Down by Index.

I have created the table node (tbnode) and child node for DDBI (ddbinode) and set the singleton property for DDBI node to false.

I have same local variable node as same as above node and the values are available.

I have one button ADD.On click the add button i need to populate the values to table node and as well as DDBI Node.

I created supply function for DDBI node and populate the values for DDBI Node.

Add Method:

IPrivateMdTest8CompView.ItbnodeElement tbnode = wdContext.nodetbnode().createtbnodeElement();

tbnode.setDescription(wdContext.currentCn_LocalVariableElement().getDescription);

wdContext.nodetbnode().addElement(tbnode);

Supply Function Method:

for(int j=0;j<wdContext.nodetbnode().size();j++)

{

wdContext.nodeddbinode().setLeadSelection(j);

IPrivateMdTest8CompView.IddbinodeElement ddbinode = wdContext.nodeddbinode().createddbinodeElement();

ddbinode.setddvalue(wdContext.currentCn_localddvalueElement().getddvalue);

wdContext.nodeddbinode().addElement(ddbinode);

}

Problem is one i got the values in the drop down and i click the second row in table again the supply function calls and reset the first row drop down to original value.

If you any problem like please provide the solution.

Thanks & Regards,

SatheshKumar R

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks

c_vdwouw
Explorer
0 Kudos

If you created the supply method by setting the supply property of the node, you should have variable 'node' available as argument of the supply method, which will be related to the table row of the triggered dropdown. Opening the dropdown does not change the lead selection of the parent node, so

ddbinode = wdContext.nodeddbinode().createddbinodeElement();
wdContext.nodeddbinode().addElement(ddbinode);

does always relate to the first row of the table (given that leadSelection == 0). With the node variable you can

IddbinodeElement ddbiElement = node.createddbinodeElement();
...
node.addElement(ddbiElement);

Former Member
0 Kudos

Hi,

Instead of "wdContext.nodeddbinode().addElement(ddbinode);"

Use

tbnode.nodeddbinode().addElement(ddbinode);

You should always use the outerNodeElement.innernodde.addEleement(InnerNodeElement).

Hope this helps.

Reagrds,

Himanshu

Qualiture
Active Contributor
0 Kudos

Have you set cardinality of your child node to 1..1?

Former Member
0 Kudos

Hi Robin,

Thanks for Reply.

No. I have set the cardinality as 0:n.

Bcoz i need to populate many values in that Drop Down.

Thanks & Regards,

SatheshKumar R

Qualiture
Active Contributor
0 Kudos

So that is correct then

Not sure what else goes wrong then; if your subnode is non-singleton and your dropdown element is bound to this subnode, then I don't see why it appears your table rows revert back to the initial value...

However, since your child node is non-singleton, a supply function shouldn't be needed (it's only mandatory for a singleton node if i remember correctly)

I haven't used your kind of construction before, but I can suspect the supply function would reset the set value for your dropdown during repopulating the subnode. You might want to check this