The drop down by Key UI element provides the list of values from the domain fixed values. The cardinality is 1..1 and type of the attribute to which the UI element is binded must have fixed domain values.
In the above screen I have binded the drop down by key UI element to the attribute of type BSTYP and the drop down UI element lists all the fixed domain values of the BSTYP.
Note : With the drop down by key UI element we can only have only fixed domain values and if we need some more option we need to include it in the dictionary domain level only.
If the drop down by Key UI element is binded to a cell editor of a table UI element the drop down can have only fixed values for all the row item where as the drop down list can be different for each row in drop down by index.
Now let us see an simple example where I am going to set a drop down by key then read and display the value selected.
Step 1 : Go to SE80 Tcode and create a webdynpro component.
Assign the component to a package or save it in a local object.
Step 2 : In the context tab of the view controller create an attribute of type BSTYP to be binded to the drop down UI element and another attribute of the type string to be binded to the text view UI element.
Enter the attribute name and type and press enter.
Step 3 : In the layout tab of the view controller. Insert a lable UI element.
Provide the id for the UI element, choose a type and press enter.
Properties of the lable UI element.
We will set the label for property after creating the drop down UI element.
Create a drop down UI element in a similar way.
Properties of the drop down UI element.
Bind the obligatory binding of the UI element selected key to the attribute BSTYP.
Create an event hanlder for the drop down UI element.
Now set the label for property of the lable UI element to point drop down
Insert a text view UI element and bind the text property of the UI element to the attribute text.
Binding the property text of text view to the attribute text.
Step 4 : Do the following in the event handler method for the drop down.
Step 5: Save and activate the whole component.
Step 6 : Create an application and test the application.
Output :
Select an element from a drop down.
Nice document ............
ReplyDelete