on 04-28-2010 4:51 PM
Hi, I am trying to populate the values in a dropdownby key UI element with values from a simple type. Can somebody explain the entire procedure ? As my dropdown box is always diabled, and I have tried everything. Is there a simple tutorial for this ?
Thank you.
Ashish
Hi Ashish,
Check the cardinality of the node bound to this control make it 1..n. Reason is, You dont have a element under the context where the data can be hold.When you set it to 1..n frame work will create one for you.else you need to create an element of the node using createandelement method.
The property selectedKey must be bound to a context attribute Key having a simple type like String with a value set.
The selectable items of the drop-down list are the keys of the value set, the displayed texts are the corresponding values. The currently selected item is given by the current value of property selectedKey.
Deepak!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks everyone. Was able to make it work.
Ashish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashish,
First create simple type and defien the enumeration whatever values you require in drop down to be populated.
now create a node with the cardinality as 0..n now craete an attribute as va_types and bind the type as simple types.
now goto do intit if you want teh drop down to be populated in initial step or goto the method which you will call for population of drop down and write the code for populating the drop down.
IPrivateSampleView.IVn_sampletypeElement obj = null;
obj = wdContext.nodeVn_sampletype().createVn_sampletypeElement();
obj.setVa_types("Select");
wdContext.nodeVn_sampletype().addElement(obj);
i believ u missed the code for populating the drop down.
Without the above code snippet the drop down will come disabled.
Hope it will work for you.
Thanks,
Regards,
Anupama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashish,
Please refer to below documents for populating data from from a simple type.
Hope it helps
Regards
Arun
Edited by: Arun Jaiswal on Apr 29, 2010 2:03 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashish,
It seems u have binded the Dropdown UI to a Node, that is why u r getting it as disabled.
try creating a context attribute and bind it to the simple type created under the "dictionaries->simpleType" section with the required values entered in the enumeration tab.
Regards,
Poojith MV
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1. create a simple type, Add Enum values to the simple type.
2. Create a context attribute say 'List' in the Context of type simple type Or Create attribute say 'List' in a node say 'ListNode' of cardinality 1-1.
3. Create UI and bind the selectedKey property to this attribute 'List' and run the application
Regards,
Amol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.