on 09-01-2005 5:42 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
DropdownByKey wont work ifyou bind with model attribute.
you have to use DropdownbyIndex.
Test it. try it and close the question.
Regards
Ruchira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.