on 05-02-2006 7:28 PM
Hello,
how can I set values for DROP_DOWN_BY_KEY element? I need to have static values such as ValueA, ValueB and ValueC and depending on user's selection define appropriate action.
Where do I define those values?
Thank you.
Hi Georgy,
Check this:
http://help.sap.com/saphelp_nw04s/helpdata/en/27/c3c241fdc6c617e10000000a155106/content.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/bb/69b441b0133531e10000000a155106/content.htm (Key Binding section).
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Maksim,
thanks for your reply.
I see in one of the examples (SWDP_TEST_EVENTS WebDynpro app) that Drop_Down_By_Keys is binded to SelectedKey which is type of WDY_APPLICATION_TYPE.
Where do I define WDY_APPLICATION_TYPE or any other type so it has values that I need such as Active/Inactive? I see that it is a Data Element. How can I assign value to it?
Thank you.
Regards,
Georgy Norkin
Message was edited by: Georgy Norkin
Message was edited by: Georgy Norkin
Message was edited by: Georgy Norkin
I cannot help with the WD ABAP API but the principle of DropDownByKey is the following:
You have a context attribute A that provides a "value set" S (S is a map of key/value pairs).
You bind the "selectedKey" property to attribute A.
If A currently contains a key K, then the drop-down list displays S(K) as its selected element.
In the drop-down list you see all values from S, but what is selected (and stored in A) is always a key.
To populate the drop-down list, you have to attach a value set to the data type of attribute A.
Armin
You can either create a DDIC type with a value set at designtime in the IDE, or you use the DDIC runtime API to get the (modifiable) type of attribute A and to put your key/value pairs into the value set.
See
http://help.sap.com/saphelp_nw2004s/helpdata/en/c5/e4884180951809e10000000a155106/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/bb/69b441b0133531e10000000a155106/content.htm
Armin
Hi Georgy,
To populate dropdown at design time follow these steps:
1. Go to dictionary create simple type.
2. Give the type name and package name.
3. Click on simple type which you have created .In the right side you will find four options definition ,enumeration,representation and database.
4.Go to enumeration click on new and give the Enumeration value and text.
5. Create value attribute in context.
6. In the property of the value attribute assign the type field to the simple type you created in the particular package.
7 Assign this value attribute to the drop down box.
Regards,
Rajeev
Hi Georgy,
To do dynamic init of drop down I would suggest to use DROP_DOWN_BY_INDEX. In this case you are working with context node which is more convinient than working with value set.
BTW, link which I post here contains dynamic init:
data: INFO_NODE type ref to IF_WD_CONTEXT_NODE_INFO
LT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST
L_VALUE type WDR_CONTEXT_ATTR_VALUE.
NODE_INFO = WD_CONTEXT->GET_NODE_INFO( ).
L_VALUE-VALUE = V1.
L_VALUE-TEXT = yesterday.
INSERT L_VALUE into table LT_VALUESET.
L_VALUE-VALUE = V2.
L_VALUE-TEXT = today.
INSERT L_VALUE into table LT_VALUESET.
L_VALUE-VALUE = V3.
L_VALUE-TEXT = tomorrow.
INSERT L_VALUE into table LT_VALUESET.
NODE_INFO->SET_ATTRIBUTE_VALUE_SET (
NAME = ATTRIBUTE1
VALUE_SET = LT_VALUESET ).
Bind selectedKey to attribute ATTRIBUTE1 (type STRING) from context.
Best regards, Maksim Rashchynski.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.