on 09-30-2011 9:14 AM
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
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you set cardinality of your child node to 1..1?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.