on 11-03-2005 8:54 AM
What is the difference between Drop Down By Index & Drop Down By Key.
How Do we retrive What value is selected in a drop down
regards
Nilesh
Thanks for the reply ..
I am making a call to a webservice which returns me 2 fields (a key and a description). I want to populate this data in the drop down box. The Desc should be visible in the box when a particular desc is selected the corresponding key should be returned and not the same selected text.
How can this be implemented.
regards
Nilesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Nilesh,
//Create ISimpleTypeModifiable to fill the dropdownbox
//XXX is your Desc field
IWDAttributeInfo soAttribInfo= wdContext.getNodeInfo().getAttribute("XXX");
ISimpleTypeModifiable soType = soAttribInfo.getModifiableSimpleType();
soType.setFieldLabel("XXXX");
IModifiableSimpleValueSet soSet= soType.getSVServices().getModifiableSimpleValueSet();
soSet.clear();
//To Get desc and key from web services you pass some information to the run the given Webservice do it here
wdContext.currentRequest_XXXViDocument_getDescnKeyArrayElement().setInfo(infonr);
wdThis.wdGetXXXController().getDescObjects();
int size = wdContext.nodeResult_getDescObjectsArray().size();
if (size != 0)
{
//Filling the desc in the dropdownbykey field
for (int i=0; i<wdContext.nodeResult_getDescObjectsArray().size(); i++ )
{
IPrivateXXView.IResult_getDescObjectsArrayElement soElement =
wdContext.nodeResult_getDescObjectsArray().getResult_getDescObjectsArrayElementAt(i);
soSet.put(soElement.getkey(),
soElement.getDesc().trim() + " " + soElement.getkey().trim() );
}
}
Implement this code for populating the drowdown when that works I can tell you the next step.
Good Luck,
Dharmi
Hi Nilesh,
Drop down bykey is normally used when the drop down data comes from a local dictionary u defined in the application.
Drop down by index in case the data is populated say from a BAPI call.
There might be more fine differences between them which I am yet to discover
Regards
MK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.