cancel
Showing results for 
Search instead for 
Did you mean: 

Populating a dropdown based on previous dropdown selection

Former Member
0 Kudos

Hi

I am using WebDynpro for Java with adobe interactive elements. On abobe form I have 4 dropdowns. I am able to populate the first dropdown values from a adaptive webservice model using context mapping and some coding. Values in second drop down depends on first dropdown selection. So on first dropdown when user selects a value, I should call a method in webdynpro, this method will make a webservice call, this will return the values for second dropdown. Here I am not sure about how to call a webdynpro java method from adobe event. Please suggest me on how to do this.

Thanks

Praveen

Accepted Solutions (0)

Answers (1)

Answers (1)

susmita_panigrahi
Active Participant
0 Kudos

Hi

For example ist dropdown is XXX and 2nd drop down is YYY.Then there is a Property on Select.So assign an action getZZZ() to this on Select propert of 1st drop down.Then in the getZZZ() method write the below code:

try

{

// populating the values into YYY type dropdown based on the XXX dropdown value selected.

typeMap = new HashMap();

if(wdContext.currentXXXElement() != null)

{

String selectedKey = wdContext.currentXXXElement().getABC();//ABC is the attribute/element of XXX drop down

ArrayList descs = (ArrayList) typeMap.get(selectedProdRefKey);

wdContext.nodeYYYNode().invalidate();

if(descs!=null)

{

for(int i=0;i<descs.size();i++)

{

IPrivateDEFView.IYYYNodeElement typeOnUI = wdContext.createYYYNodeElement();//DEF is the view name

typeOnUI.setGHI(String)descs.get(i)); //GHI is the element of YYY node

wdContext.nodeYYY().addElement(typeOnUI);

}

}

wdContext.nodeYYY().setLeadSelection(-1);

}

else

{

wdContext.nodeYYYNode().invalidate();

IPrivateDEFView.IYYYNodeElement typeOnUI = wdContext.createYYYNodeElement();

wdContext.nodeYYYNode().addElement(typeOnUI);

}

}

catch(Exception ex)

{

wdComponentAPI.getMessageManager().reportException("Unable to get the values. Please check the server logs. ",true);

ex.printStackTrace();

}

Thanks

Susmita

Former Member
0 Kudos

Hi Susmita,

Thanks for the reply. Your suggested code is for dorpdowns with in WebDynpro view. But I have dropdowns on adobe form. Can you suggest me on how to populate a adobe dropdown based previous dropdown, dropdown values are coming from a webservice. So on each dropdown select I have make a rfc call. In adobe I am not sure about how to trigger a server event when we select a dropdown.

Regards

Praveen

Former Member
0 Kudos

Hi Susmita,

Thanks for the reply. Your suggested code is for dorpdowns with in WebDynpro view. But I have dropdowns on adobe form. Can you suggest me on how to populate a adobe dropdown based previous dropdown, dropdown values are coming from a webservice. So on each dropdown select I have make a rfc call. In adobe I am not sure about how to trigger a server event when we select a dropdown.

Regards

Praveen