cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically populating dropdowns based on previous dropdown selections

deepa_prabhu
Participant
0 Kudos

Hi ,

I have two dropdowns say "Country" and "state".

Based on the selection in the dropdown "Country" my contents of "state" dropdown should change?

Can anyone help me out ASAP with solution as to how dynamically we can populate dropdowns based on previous dropdown selections?

Immediate help is greatly required and appreciated.

Accepted Solutions (0)

Answers (1)

Answers (1)

detlev_beutner
Active Contributor
0 Kudos

Hi Deepa,

this depends a bit under what circumstances you want to achieve this behaviour?!

(a) Your are developing your own application, placing the two dropdowns on the screen. Then I don't know really understand the problem - on the first dropdown you can react (it's your decision if on client or on server side) on a changing value, and fill the second dropdown box with values corresponding to the value chosen in the first one. On client side, this may be a bit more tricky for you would have to put the JavaScript into the page, accessing the dropdown values; if this is your question search for "javascript htmlb" on SDN to get different hints for that scenario. If you react on server side, there is absolutely nothing special, just filling the model of the second dropdown with the appropriate values in an onFirstDropdownSelection method.

(b) If you have defined custom predefined properties, which you want to declare as depedendent, see this HowTo guide: http://service.sap.com/nw04 - How-to Guides - Portal, KM & Collaboration - KM - Configuring Predefined Properties with Dependent Values

Hope it helps

Detlev

PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!

detlev_beutner
Active Contributor
0 Kudos

Hi,

has the answer been of any value for you? If yes, please consider rewarding points for helpful answers! Thanks in avance!

Best regards

Detlev