cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down UI Element

Former Member
0 Kudos

Hi,

I need to have a drop down UI element in my view and this drop down should contain the values from a bapi.

Which is the type of drop down i should use? Is it dropdownbykey or dropdownbyindex?

And also how to fetch the values in the dropdown ui element dynamically?

Regards,

Padmalatha.K

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Padma,

Go for drop down by index in this case.

Here, <outputnode> is the node of your RFC that holds the result and <nodename> is the node binded to your ddi.

for(int i=0; i<wdContxt.node><outputnode>().size();i++)

{

IPrivate<viewname>.I<nodename>Element ele = wdContext.node<nodename>().createElement();

ele.set<attribute>(wdContext.node<outputnode>().getElementAt(i).get<attribute>();

wdContext.node<nodename>().addElement(ele);

}

for ddk:

IWDAttributeInfo attr = wdContext.getNodeInfo().getAttribute(<attributename>);

ISimpleTypeModifiable sim = attr.getModifiableSimpleType();

IModifiableSimpleValueSet vs = sim.getSVServices().getModifiableSimpleValueSet();

for(int i=0; i<wdContxt.node><outputnode>().size();i++)

{

String temp = wdContext.node<outputnode>().getElementAt(i).get<attribute>();

vs.put(temp,temp);

wdContext.currentContextElement().set<attribute>(<value>); // to get initial selection.

}

Regards,

Murtuza

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Your requirement is to put values into DropDown Dynamically..

So, use DropDownByIndex UI Element

ArrayList al=new ArrayList();

loop upto the size of data coming from BackEnd

IPrivate<ViewName>View.I<DDNode>Element ele=wdContext.create<DDNode>Element();

ele.set<value>(<Value from Vackend>);

al.add(ele);

end loop

wdContext.node<DDNode>().bind(al);

Regards

LakshmiNarayana