cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a drop down with data coming from a simple type

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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!!!

Answers (5)

Answers (5)

Former Member
0 Kudos

Thanks everyone. Was able to make it work.

Ashish

Former Member
0 Kudos

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

p330068
Active Contributor
0 Kudos

Hi Ashish,

Please refer to below documents for populating data from from a simple type.

http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-tech...

http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-tech...

Hope it helps

Regards

Arun

Edited by: Arun Jaiswal on Apr 29, 2010 2:03 PM

former_member214651
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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