cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with DropDown in a table

Former Member
0 Kudos

Hello,

I have created a table with some elements and a drowndown. My problem is if I choose an entry in the drowndown menu in one row and select another row, evertime time the new chosen dropdown entry will overwrite all the other choosen entrys in the other dropdowns. How can I fix that? If I work with local simple types it works, but in my case I get the entrys from a context node mapped to an external RFC interface.

Any ideas?

Regards,

Frank

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

You code should be like this.

for (int i=0; i<3; i++){

IPrivateKontierungView.IPo_Items_CopyElement Text = wdContext.createPo_Items_CopyElement();

Text.setShort_Text_Copy("Test1"+i);

wdContext.nodePo_Items_Copy().addElement(Text);

for (int j=0; j<4; j++) {

IPrivateKontierungView.IT_Coinnen_CopyElement Dropdown = wdContext.createT_Coinnen_CopyElement();

Dropdown.setAufnr("Test2"+j);

Text.nodeT_Coinnen_Copy().addElement(Dropdown);

}

}

Regards,

Ajay

Former Member
0 Kudos

Yes, that was it!! Thanks to you all!!

Regards,

Frank

Former Member
0 Kudos

Hi Ajay

could you show how this code snippet would change if using dropdownbykey?

thanks

Anton Kruse

Former Member
0 Kudos

Do you know if we can achieve the same results in an interactive form table?

Thanks

Ram

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

True.You have to populate the DropDown Node for each element of the TableNode.

The code above is the exact thing that needs to be done.

Regards,

Ajay

Former Member
0 Kudos

Hm, in my case, I get three rows but the entries for the drowdown are only shown in the first row, the dropdowns of the other two rows are empty. Here is the source code I use. The Node Po_Items_Copy is the table node and T_Coinnen_Copy the dropdown node:

for (int i=0; i<3; i++){

IPrivateKontierungView.IPo_Items_CopyElement Text = wdContext.createPo_Items_CopyElement();

Text.setShort_Text_Copy("Test1"+i);

wdContext.nodePo_Items_Copy().addElement(Text);

for (int j=0; j<4; j++) {

IPrivateKontierungView.IT_Coinnen_CopyElement Dropdown = wdContext.createT_Coinnen_CopyElement();

Dropdown.setAufnr("Test2"+j);

wdContext.nodeT_Coinnen_Copy().addElement(Dropdown);

}

}

Regards,

Frank

Former Member
0 Kudos

Hi

Assuming you have following node structure for the table.

TableNode

|_

DropDownNode(Node for the DropDown in table)

Please make sure that the DropDownNode is Non singleton.

This should solve your problem.

Regards,

Ajay

Former Member
0 Kudos

Hi to all,

it is exactly the same structure you have described. I have created a table node and in this node another node for the dropdown. But I did not change the singleton attribute before, so I changed it to false

Now the problem changes that only the dropdown box of the first row in the table shows the entrys, the other dropdowns are empty.

Any other ideas? (by the way, I use drowndown by index, must I use dropdown by key?).

Regards,

Frank

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Use the below code to add elements to Dropdown inside table.

Use dropdownByindex

Steps:

1)Set the Node dropdown of property singleton to false.

2)Add the dropdown element to the table node

Using the code with bold lines below..

IPrivate<ViewName>.ITableElement Text = wdContext.createTableElement();
Text.set<Att>("aaaa");
//Ading elements below the table node
<b>wdContext.nodeTable.addElement(Text);</b>

for (int i=0; i<4; i++) {
IDropdownElement drop = wdContext.createDropdownElement();
drop.set<dropAtt>("test " +i);
//Ading values to dropdown and intrun to table node
<b>Text .nodeDropdown.addElement(drop);</b>
}

Regards,

Vijayakhanna Raman

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi Frank

After you've changed singleton to FALSE check that DropDownNode is filled in for each elements of TableNode. It seems the node is filled only for the first TableNode element right now.

You can also use DropDownByKey in the table. In the case 'selectedKey' property of the control should be bound to some attribute from TableNode and the simple type of the attribute must have an enumeration. However, list of entries would be the same for all drop-downs in all the rows.

BR

Sergei

Former Member
0 Kudos

For non-singleton child nodes, there exists a node per node <b>element </b>of the parent.

So you must populate the drop-down entries for each node element of the table node.

Armin

Former Member
0 Kudos

Sounds like you are using a singleton instead a non-singleton. The effect is that in all rows the value of the lead selected element is shown.

Can you post the context structure and the data binding of the drop-down list?

Armin