cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown field

Former Member
0 Kudos

Hi all,

I am trying to add dropdown field in a project. The values of drop down will be provided

by us from front end and the value selected by the user will be send to back end.

Can you please help me, how to add drop down.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Umang,

DropDownByKey provides static data in DropDown.

DropDownByKey: Dropdown by key is a UI element which is having key-value pair. You can put this key- value using the SVS service or from the dictionary simple type.

When u want to use data dictionary type.For this create a dictionary of simple type in the dictionary.

Creating the Simple Type:

Ur project>dictionaries>Data Types-->Simple Types right click and select Create Simple Type.

After entering the name and package, open that and click on "enumeration" tab at the bottom of the same. Now add the Value and Description to be displayed.The created simple type can be used for DropDownByKey.

Binding it to the UI element:

Now create a value attribute and change the type to the dictionary type(created simple type). Finally bind the DropDownByKey UI element to the value attribute.

http://help.sap.com/saphelp_nw70/helpdata/EN/2b/1583575708a943833fdcd24c953ab8/frameset.htm

http://help.sap.com/saphelp_nw70/helpdata/EN/67/c0a967bbd8ad4bb536bbd95344197a/frameset.htm

Thanks n Regards,

Jhansi Miryala

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Umang,

Just follow these steps

1. Add a Dropdown by Key UI Element.

2. Create a simple type for example u201Ctempu201D in Dictionaries

3. Open the created simple type temp and select Enumeration tab

4. Click on New button and enter Value and Description

5. Enter all the dropdown Value and Description

6. Create a context element

7. Change the type of the context element to the created simple type by selection the corresponding package.

8. Now bind the u201CSelected Keyu201D property of the Drop down by Key UI Element to the context element.

9. To save the same in the backend, change the type of corresponding element of the bean model to the simple type.

Revert back for any clarifications

Regards,

Rajesh A

Former Member
0 Kudos

Hi,

If iam not wrong then u mean to say how to add values to drop down provided from front end and how to send it to back end right?

Regards

Surender Dahiya

Former Member
0 Kudos

Yes

Former Member
0 Kudos

Hi Umang,

As per previous replies, if you do not want use Simple Type for adding data to the Drop Down then as

I understand that in one of the Views (suppose FirstView) you will adding some data, which should become the values for a dropdown in some other view (suppose Second view) .

The solution for this can be as:

1. Create a Context Node and a Context attribute of Type String in the FirstView

2. Set the cardinality of this node to 1 : n

3. Create a Context Mapping for this Context to the SecondView through the Component Controller.

4. In the FirstView using Apply Template create a table with InputField as the Cell-Editor for your column for the Context Node created.

5. Create the button in the FirstView to Add elements to the Node. In the action add code as:

a. Create an element using wdContext.node<ur_node_name>().create<node_name>element();

b. Set the Element value to empty String

c. Add this element to the node using wdContext.node<ur_node_name>().addElement(<ele_var>);

6. In wDoInit hook method add:

wdContext.current<Node_name>Element().set<element_name>("");

7. In the SecondView create a DropDownbyIndex UI element and bind its texts property to the context elemt mapped to FirstView.

8. Create another button to navigate to the Seciond View using Plugs.

At Runtime, once you have added elements in the FirstView and Navigate to SecondView, you will see the DopDown filled with valus.

Hope it helps.

Regards,

Alka.

Edited by: Alka Panday on May 21, 2008 2:35 PM