cancel
Showing results for 
Search instead for 
Did you mean: 

Column with dropdown with different values in each cell

Former Member
0 Kudos

Hello,

I have a Table and one of the columns contains a dropdown list (dropdownbykey). My problem is that the list of values for each drop down element is different because it depends on the value in the rest of the row cells. Obviously I need to calculate the values dynamically at runtime.

I have created a context node and linked it to the table columns, one of the attributes in the node is linked to the 'selectedKey' property of the dropdown. Then in my code I try to give the list of values to this attribute using the method set_attribute_value_set from the if_wd_context_node_info interface. The process it's explained in the DEMO_UIEL_STD_SELECTION component.

But I only get the same values for each row.

I would like to know if it's possible to have dropdowns with different values in the same column of a Table, and if so any indication of how to do that.

Best regards,

Accepted Solutions (0)

Answers (1)

Answers (1)

ChrisPaine
Active Contributor
0 Kudos

Hello Javier,

unfortunately you cannot use dropdown by key if you want to have different dropdowns per line of your table.

Instead you will need to use dropdown by index, and bind your dropdown to a subnode of the table element (ensure that this is a non-singleton node).

To make life easier for yourself, I would also have an attribute in your main structure that holds the selected value of the dropdown by index - update this value on any "onSelect" action of the dropdown by index.

e.g. for a table that holds addresses:

Context Node Address: attribute street attribute city attribute country attribute region subnode regionlist ...attribute regionkey ...attribute region_text table - bound to node address input field bound to street input field bound to city dropdown by key bound to country (onSelect event populates subnode regionlist) dropdown by index bound to subnode regionlist, text bound to region text, (onSelect event populates address element attribute region with key field of selected element).

I hope this helps,

Chris