You are on page 1of 4

Value Selector

Exercise
Chapter: Generic UI Services
Theme: Value Selector DropDownByey
At the end of this Exercise, you will be able to:
Create a DropDownByKey input element
!Development "#$ectives
This exercise has the following obecti!es:
"i!e the user the possibility to choose the !alue for the #lane Type from a
DropDownByKey input element$
% &esult
%n this exercise, you will create a
DropDownByKey input element for the
#lane Type$
Template Solution:
&eb Dynpro Component: WD_07S_VALUE_SELECTOR
Application: WD_07S_VALUE_SELECTOR
Startin' (oint of this exercise:
'
(alue )elector
Exercise
&eb Dynpro Component: *WD_##_MESSAGES
or the template solution
&eb Dynpro Component: WD_06S_MESSAGES
"roup number: ++ stands for the two,digit group number
) Developin'
)*! Copy +e# Dynpro Component
Copy your &eb Dynpro Component *WD_##_MESSAGES or the
template solution WD_06S_MESSAGES to name
*WD_##_VALUE_SELECTOR.
)*% ,-- attri#ute (.,/ET0(E to the context o1 the
component controller
-ocate the Component Controller node in the proect structure that is
located immediately under the component$ Double clic. on Component
Controller to open the Custom Controller editor$
, Add attribute #-A/ET0#E to context node 1-%"2T%/13
2int: )elect Create Usn! W"ar# $% Attr&'tes (orm Components o(
Str')t're from context menu of node 1-%"2T%/13$
)*) ,-- attri#ute (l,/ET0(E to the context o1 the view
controller I/(UT2VIE+
/a!igate to the Conte*t tab of !iew controller %/#4T5(%E&$ Choose
Up#ate Mappn! from the context menu of node +L,G-T,.+O to add the
attribute #-A/ET0#E$
)*3 ,-- .a#el an- DropDownByey 1or (.,/ET0(E to the
layout o1 I/(UT2VIE+
"o to tab La/o't and add a label named #-A/ET0#E5-ABE-5' and
a DropDownByKey named #-A/ET0#E5D63#D3&/5' to group
"634#5'$ The two new elements should be placed between the input
field for the Date and the button$ Bind the DropDo0n1/2e/ to the context
attribute #-A/ET0#E$
)*4 ,-$ust component controller metho- 5.IG6TT,B25I..
/a!igate to the Met3o#s tab of the component controller and double,
clic. on the method 1-%"2TTAB51%-- to open the editor$
Adust the method:
7
(alue )elector
Exercise
, "et also the context !alue for #-A/ET0#E
, 4se #-A/ET0#E also in the where clause of the select statement
)*7 ,-- attri#ute (.,/ET0(E to the context o1 the view
controller "UT(UT2VIE+
/a!igate to the Conte*t tab of !iew controller 34T#4T5(%E&$
Choose Up#ate Mappn! from the context menu of node +L,G-T,.+O to
add the attribute #-A/ET0#E$
)*8 ,-- .a#el an- DropDownByey 1or (.,/ET0(E to the
layout o1 "UT(UT2VIE+
"o to tab La/o't and add a label named #-ABET0#E5-ABE-5' and
a DropDownByKey named #-A/ET0#E5D63#D3&/5' to group
"634#5'$ The two new elements should be placed between the input
field for the Date and the button$ Bind the DropDo0n1/2e/ to the context
attribute #-A/ET0#E$ 8a.e it rea# onl/9
)*9 Create a new metho- 1or creation o1 the value ta#le on the
I/(UT2VIE+
/a!igate to the Met3o#s tab of the input !iew and create a new method
with the name ()5#-A/ET0#E$ Double,clic. on the name of the newly
created method to na!igate in the editor$
Add coding for:
, "et nodeinfo for node 1-%"2T%/13
, Build the !alue set table$ Create the following entries:
ey Val
ue
:;:,
;<<
:;:,
;<<
A='<,
=<<
A='
<,
=<<
A='> A='
>
DC,
'<,'<
DC,
'<,
'<
, )et the !alues to context attribute #-A/ET0#E of node
1-%"2T%/13
)*: Invo;e metho- VS2(.,/ET0(E
=
(alue )elector
Exercise
%n!o.e method ()5#-A/ET0#E in method &3D3%/%T on !iew
%/#4T5(%E&$
2int: 4se &eb Dynpro Code &i?ard$
)*!< Disa#le 1iel- chec;s
"o to the A)tons tab on !iew %/#4T5(%E& and double,clic. on
action GO$ Comment out the call of the chec. method C2ECK5%/#4T$
)*!! Create +e# Dynpro ,pplication
6ight mouse clic. on the component node and select Create ,@ We&
D/npro An0en#'n! A&eb Dynpro ApplicationB from the context menu$
Create the application ha!ing the following attributes:
/ame: Aaccept defaultB
Description: (alue )elector
Accept all default settings and press Sa4e and run your application$
;
(alue )elector
Exercise