cancel
Showing results for 
Search instead for 
Did you mean: 

Context binding with dropdownbykey

Former Member
0 Kudos

Hello,

I am programming my first little application and would like to use the dropdownbyindex or dropdownbykey field.

The programm is writing some data to the database. For this the context of the fields is binded to a context that is based upon the database structure.

Without using the dropdown fields everything is working fine.

When I now want to use the dropdown field I have the "problem" that I think that I should bind the context to node that supplies the options/choices for the dropdown field. But how can I bind this dropdown field to the context that I want to write to the database also? Or can I only bind to the context with the options and have to read the choice and put it in the context to save while saving the record?

Hoping not to write to confused,

Maximilian

Accepted Solutions (1)

Accepted Solutions (1)

alejandro_bindi
Active Contributor
0 Kudos

For this the context of the fields is binded to a context that is based upon the database structure.

So I assume you meant to say that your node (which has an attribute/field among others, which should have a dropdown) has the same structure as a database table.

In that case it will be easier to use DropDownByKey. You just have to set the possible attribute values to that field. For DropDownByIndex you would have to modify your context node structure instead, creating a subnode for the field.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

please refer to this standard example

WDR_TEST_UI_ELEMENTS

Former Member
0 Kudos

Maximilian,

It's always recommended to create a separate context variable for the dropdown fields which will host your key data.

This variable will hold your key fields used for your dropdown. You need to write code to refer to the selected element and store value accordingly i main context node.

Incase, you want to use the existing context node, there can be issues as the key fields of data might get rrepeated in the dropdown.

Also, dropdown by key is mostly used in scenario's where you need to fill data explicitly based on some condition at runtime. If you are sure your dropwodn wouldn't change, i would recommend go with dropdpwn by index method.

Regards,

SV

Former Member
0 Kudos

Hello and thank you really much for your answers. So I got it.

Thx, Maximilian

Former Member
0 Kudos

Maximilian,

check this link it will give you some sample example names.

Thanks

Bala Duvvuri

Former Member
0 Kudos

Thx for your reply. Unfortunately I cannot see any link. Could you put it again in the message?

Thx, Max

Former Member
0 Kudos

Hi,

Please see the beow link.

[|]

This will give a general idea of Dropdown by Index.

Actually u only need to do this:

1) Bind ur dropdown with a context attribute.

2)Get access to the node_info of the node in which the attribute resides.

3)Populate the dropdown values as shown in the thread.

4) In the OnSelect fn of drop down.

Get vals selected by user and use them ne where.

I hope it helps.

Revert back with issues.

Regards,

Sumit