Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Sep 30, 2011 at 08:27 AM

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

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • avatar image
    Former Member
    Sep 30, 2011 at 01:53 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 04, 2011 at 08:09 PM

    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);

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 01, 2012 at 12:53 PM

    Thanks

    Add comment
    10|10000 characters needed characters exceeded