Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to create a Dropdown in webdynpro

Hi ,

I am a beginner in Webdynpro , Java . Request you to plz help me ..

My requirements -

1. How to create a dropdownbyindex in a view and populate it with some static values passed to the Context .

2. Upon selection of a value from the dropdown and clicking on the Submit button , how to save the value?

Context -

Node - Season

Attribute - Seasonofyear

Kindly Reply

Thanks in Advance!!

Regards

Smita

Former Member
Former Member replied

Hi smitha,

I had checked out.. this is working fine for ur requirement

public void wdDoInit()

{

IPrivateSamView.ISeasonNode snode = wdContext.nodeSeason();

IPrivateSamView.ISeasonElement sele = snode.createSeasonElement();

snode.addElement(sele);

IWDAttributeInfo attributeInfo = wdContext.nodeseason().getNodeInfo().getAttribute(IPrivateMain.IseasonElement.season);

ISimpleTypeModifiable sea = attributeInfo.getModifiableSimpleType();

sea.setFieldLabel("SEASON");

IModifiableSimpleValueSet valueSet =sea.getSVServices().getModifiableSimpleValueSet();

valueSet.put("0"," AAA");

valueSet.put("1","BBB");

valueSet.put("2","CCC");

}

i had created a attribute called copy under the node "season". Now i copied from the season attribute to copy attribute.

then onaction save

{

IModifiableSimpleValueSet rea = wdThis.wdGetContext().getContext().getModifiableTypeOf("season.season").getSVServices().getModifiableSimpleValueSet();

wdContext.currentSeasonElement().setCopy(rea.getText(wdContext.currentSeasonElement().getSeason()));

}

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question