cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByKey UI Element and Model Attribute

Former Member
0 Kudos

Hi

The DropDownByKey UI Element can be linked to value attribute, which are simple types.

Now if i try to link them to model attribute which are simple types pertaining to some model classes, its not happening.

so my question is how to attach any DropDownByKey UI Element with Model attribute which will get data from model to which it is attached?

thanks

Srikant

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

D.V.,

Whether or not DDK (DropDownByKey) works with model attribute depends on type of attribute (actually, type of model class property that stays behind this attribute)

If the type contains enumeration itself then DDK works.

So, you have the following options (dynamically populating values set will not work here):

1. Alter type on back-end to include enumeration

2. Use DDI (DropDownByIndex) as suggested here

3. Create sub-node with cardinality 1..1 (better keep singleton false), then add value attribute with the same basic type (string, int etc) and set it flag calculated to true. WD will generate getter / setter for this attribute -- just return / set original model attribute in this method. Next:

3.a Either create new simple DDIC type for calculated attribute and define enumeration here

3.b Or modify SVS of calculated attribute at run-time as suggested in this thread

Valery Silaev

EPAM Systems

http://www.netweaverteam.com/

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

DropdownByKey wont work ifyou bind with model attribute.

you have to use DropdownbyIndex.

Test it. try it and close the question.

Regards

Ruchira

Former Member
0 Kudos

Hi Srikant,

Use DropDownByIndex as suggested by Jaydeep. Then you needn't write a single line of code for populating the dropdown. Whenever the node is populated from the model, the DropDown is automatically filled with data.

Best Regards,

Nibu.

Former Member
0 Kudos

Hi Srikant,

Use DropDownByIndex UI element to get the data from model attribute. Specify the model attribute in the texts property of the DropDownByIndex. It will work.

Regards,

Jaydeep

Former Member
0 Kudos

Hi Srikant

Ideally you shoud use SVS to populate the dropdownbykey UI element.

IWDAttributeInfo attInfo=wdCOntext.node<nodename>().getNodeInfo().getAttribute(<name of the attribute>);

/* Info of the attribute which is attached to dropdown UI element */

ISimpleTypeModifiable ist =attInfo.getModifiableSimpleType();

IModifiableSimpleValueSet svs=ist.getSVSErvices().getModifiableSimpleValueSet();

svs.put(<key>,<value>);

populate the key and value from the model node.

Kishore