Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Punit Parikh Absent Member.
Absent Member.
1539 views

Creating Dynamic Dropdown Lists

Hello,

I would like to know how I can populate a dropdown list based on the value selected in previous dropdown list..
For example - I have a DDL1 and DDL2 on a page.
I want to populate values in DDL2 based on the value selected in DDL1.
Initially, I will populate values in DDL1 and DDL2 would be blank.

Note: I need to fetch the values for DDL2 from the database based on the value selected in DDL1.
0 Likes
4 Replies
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: Creating Dynamic Dropdown Lists

You can't get a dynamic list. All the list values need to be loaded at login. It is possible, however, to set up a script that updates the project lists regularly based on the contents of the database. But you will have to do that yourself.

The first of the wizards in the workflow page in Customize is for creating dependencies between values in a field and the list displayed in another field. You can take that as your point of departure when setting up things.
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
TracyH Absent Member.
Absent Member.

Re: Creating Dynamic Dropdown Lists

Jan,

Is this still true in ALM 11?

I have a scenario where I have a parent child relationship and that works fine. The users would now like to enable multi-select on the parent and the child drop-down be comprised of the child values for each of the parent values.

 

I was hoping I could do that easily but I am struggling as to how to implement. Currently when the Parent value changes I set the List property of the child field to the List name for example = Lists("Listnamehere")

 

Any thoughts or suggestions?

0 Likes
Highlighted
Trusted Contributor.. bton99 Trusted Contributor..
Trusted Contributor..

Re: Creating Dynamic Dropdown Lists

Hi
Jan is right in his earlier reply - All the Lists are loaded at login.
But what you can do is have several lists,  - for the same field - but only  'display'  the appropriate one.


So you have a DDL1 list,
Then, rather than just a single DDL2 list you have several:
A list for               DDL2_if_DDL1_is_A
and a list for        DDL2_if_DDL1_is_B
etc - as many DDL2 lists as you have items in DDL1 if thats whats needed.

 

Then you need some workflow code to display the correct list for DDL2.

in the FieldChange event for whatever module you're in
Do a check for the DDL1 field value
with a case select to set the list for the second field.

(Using fieldChange, the second list will be ready as soon as the first field has changed.)

 

e.g. in Test Plan module, in Sub Test_FieldChange()


          Select   Case Test_Fields.Field("DDL1 field").Value
                    Case "Value A"
                    Test_Fields("DDL2 field").List = Lists("DDL2_if_DDL1_is_A")

 

                    Case "Value B"
                    Test_Fields("DDL2 field").List = Lists("DDL2_if_DDL1_is_B")
etc.etc

 

(Actually I prefer to create my own sub, which does the above value check and list assignment, and call that from the _FieldChange. And if I assign several lists I have a separate sub for each, and call them in turn. It all just helps to isolate any future changes if you add anoher value to the first list)

 

Hope this helps,

TimG

0 Likes
Established Member.. Sneha_MS
Established Member..

Re: Creating Dynamic Dropdown Lists

Hi Jan,

Can you please share sample script to dynamically store list in DB and can be called fr mALM workflow?

Thanks,

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.