on 04-21-2011 7:41 AM
HI,
I have create a Table with multiple colums, a column with a Drop down by index is also created in which we need to populate
multiple items. To achieve the same, once the user selects an item in the drop down we are displaying the model window in which we select multiple items and the same has to be displayed in the parent table dropdown.
I am stuck in the following area, After selecting multile items in the dropdown in the first Row, after we move to second Row when we select multiple vaues in the drop down the drop down values are getting overriden the with items in the first Row.
Please suggest the way forward ??
Thanks,
vijay.
Hi,
I hope the node bound to the DDI is placed as child under the parent table node. If yes then set the Singleton property of the child node to false.
Thanks & Regards,
Vishweshwara P.K.M.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
The following is the code used to select the items(topics) from the modal window and to be displayed in the parent table dropdown:
for(int i=0;i<wdContext.nodeselectedTopics.size();i++) // topics retrieved from the modal window and being iterated
{
tableElements=wdContext.createStoredTopicsElement();
tableElements.setSTopics(wdContext.nodeselectedTopics.getSelectedTopicsElementAt(i).getTopicssets()) ;
wdContext.nodeStoredTopics().addElement(i,tableElements); // All the values being stored in the value node StoredTopics
// in the parent Table
}
With the above code all the elements in value node are being overridden with the vaues newly entered.
please suggest.......
Thanks
vijay
There you are....
int sizeTable = wdContext.nodeTableNode().size();
IPrivateMyView.IDDINodeElement element = null;
IPrivateMyView.ITableNodeElement tableNodeElement = null;
for (int i = 0; i < sizeTable; i++) {
tableNodeElement = wdContext.nodeTableNode().getTableNodeElementAt(i);
for(int j=0;j<wdContext.nodeSelectedTopics().size();j++)
{
element = wdContext.nodeDDINode().createDDINodeElement();
element.setSTopics(wdContext.nodeSelectedTopics().getSelectedTopicsElementAt(i).getTopicssets());
tableNodeElement.nodeDDINode().addElement(element);
}
}
TableNode is your table ....
DDINode is your DDI node. This should be declared as a child node of TableNode and its Singleton property should be set to False
I am assuming that your table already holds data. If not use:
tableNodeElement = wdContext.nodeTableNode().createAndAddTableNodeElement();
Regards,
Himanshu
Hi Himanshu,
your code is very close.............
> for (int i = 0; i < sizeTable; i++) {
> tableNodeElement = wdContext.nodeTableNode().getTableNodeElementAt(i);
The above line of code is rewriting the code again for the second row..................
The above code is changed to the following
tableNodeElement = wdContext.nodeTableNode().getTableNodeElementAt(wdContext.wdContext.nodeTableNode().size()-1);
for(int j=0;j<wdContext.nodeSelectedTopics().size();j++)
{
element = wdContext.nodeDDINode().createDDINodeElement();
element.setSTopics(wdContext.nodeSelectedTopics().getSelectedTopicsElementAt(j).getTopicssets());
tableNodeElement.nodeDDINode().addElement(element);
}
The above code is not overwriting earlier selected items in the dropdown but blank values are displayed in the previous row.
Please suggest...........
Thanks
vijay
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.