on 08-24-2009 8:32 AM
Hi,
is there sample code for filling drop-down listbox?
Thanks.
Hi Cemil Bozlagan,
Create a context variable and bind it to the DropdownByKey element.
Use this coding in wdDoInit()
IWDAttributeInfo attInf = wdContext.getNodeInfo().getAttribute(wdContext.currentContextElement().ATTRIBUTENAME);// Name of the attribute
ISimpleTypeModifiable stm = nameInf.getModifiableSimpleType();
IModifiableSimpleValueSet svs= stm.getSVServices().getModifiableSimpleValueSet();
svs.put("key1", "Value1");
svs.put("key2", "Value2");
svs.put("key3", "Value3");
// like this add as many values as you want
Regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Step 1. Creating a web dynpro project. ex(Extended_Value_Selectoru2019)
Step 2. Creating a simple type u2018Objectu2019.
Web dynpro explorer->Extended_Value_Selector->Dictionaries->local dictionary->data types->simple types.
Confirm by choosing finish.
Let the data type be string.
Choose the tab Enumeration.
Add value and text for the new element.
Confirm by choosing finish.
Populate the enumeration with some elements.
Step 3. Creating a web dynpro component.
step 4.
write this code,
IWDAttributeInfo attr=wdContext.getNodeInfo().getAttribute(IPrivate<view>View.IContextElement.DYNAMIC);
ISimpleTypeModifiable mtype=attr.getModifiableSimpleType();
IModifiableSimpleValueSet value=mytype.getServices().getModifiableSimpleValueSet(0;
value.put("111","aaa");
value.put("222","bbb");
......
Regards,
Sunaina Reddy T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Cemil Bozlagan ,
Dropdown list box gets the value from Simple type EnmerationIn .
Using EVS u can dynamicaly create Enumeration.
Here is the SAP technical link which describes Creating Extended Value Selector (EVS) - Static and Dynamic in Web Dynpro for Java.
Search in SAP technical.com by giving the string Dynamic Enumeration
Follow the procedure:-
Create a context attribute dynamic of type String.
write the code for dynamic enumaration
IPrivate<view>View.ICOntextElement ele=wdContext.createContextElement();
IWDAttributeInfo attr=wdContext.getNodeInfo().getAttribute(IPrivate<view>View.IContextElement.DYNAMIC);
ISimpleTypeModifiable mtype=attr.getModifiableSimpleType();
IModifiableSimpleValueSet value=mytype.getServices().getModifiableSimpleValueSet(0;
value.put("pen-1","pen");
value.put("book-1","book");
Regards,
srikanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.