cancel
Showing results for 
Search instead for 
Did you mean: 

Need to populate multiple items in Drop Down by Index (created in a Table)

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Answers (0)