cancel
Showing results for 
Search instead for 
Did you mean: 

Populate dropdowns dynamically - WD Java

Former Member
0 Kudos

Hi friends,

I have two dropdowns - country and region.

On selecting the country, all the regions corresponding to that country must be populated in the second dropdown.

I've brought all the values for the country and region via BAPI calls from the R/3 backend, and I've used two nodes 'countryNode' with attributes 'key' and 'value' and 'regionNode' with attributes 'key' ,'value' and 'countryKey'. The dropdown should be populated in such a way that the region text should be displayed and the regionId should be sent back.

How do we selectively load the specific data from the region node, and how do we specify the text and key values to the dropdown at runtime?

I'm using Adobe LiveCycle Designer 7.1 and Adobe Reader 7.0.9

Thanks in advance.

Regards

Anil Madhavan

Accepted Solutions (0)

Answers (1)

Answers (1)

amolgupta
Active Contributor
0 Kudos

hi,

to populate the dropdown list you can do it...

<b>1). manually or

2). by code</b>

<b>1). manually</b> go to interactive form->edit

go to Object tab->field tab ->

you must see something like

List Items :

Text + x

click on the green + sign...

it promps you to type. type in the value press enter... and so on...

<b>2) by Code...</b>

//set up contents of a drop down list dynamically...

IWDAttributeInfo countryInfo = wdContext.nodeTravelData().getNodeInfo().

getAttributeInfo().getAttribute("DestinationCountry");

ISimpleTypeModifiable countryType =

countryInfo.getModifiableSimpleType();

IModifiableSimpleValueSet countryValueSet =

countryType.getSVServices().getModifiableSimpleValueSet();

countryValueSet.put("1","Germany");

countryValueSet.put("2","UK");

this code is written in wdDoInit() method.

<b>PLUS</b> you have to create simple types for it.

(Dictionaries->Local Dictionary->Simple types)

the context attribute which will be used for drop down should be mapped to this Simple type...

(ContextAttribute->properties->type)

Further make cardinality of node= 1..1,, that should be fine.

hope this helps.

regards,

-amol gupta