Populating a dynamic dropdown box - based of another dropdown box

8 views
Skip to first unread message

woodsaa

unread,
Jan 31, 2020, 2:31:58 AM1/31/20
to orb...@googlegroups.com
Hi hoping someone can assist,

I have seen many posts about this issue however they have left me more
confused than where I started.

I have a dropdown box called "Specialty" & a dynamic dropdown box called
"Referral declined reason".

I would like it so that when one of the list items in "Specialty" is
selected the "Referral decline reason" dynamic dropdown box is populated
with reasons specific to each specialty.

e.g:

Radiology options:

"X-ray not accompanying patient"
"Test results inconclusive"

Medicine options:

"Patient did not attend clinic"
"Insufficient evidence"

Surgical options:

"Surgery waiting list to long"
"Patient cancelled surgery"

Where do I tell the dynamic dropdown box to pull the above options from?

test-eform.txt <http://discuss.orbeon.com/file/t375768/test-eform.txt>

Hope that makes sense.

--
Sent from: http://discuss.orbeon.com/

Alessandro Vernet

unread,
Jan 31, 2020, 2:36:06 PM1/31/20
to orb...@googlegroups.com
Hi,

In your case, I wouldn't use a Dynamic Dropdown for "Referral declined
reason". Instead, I would create 3 Static Dropdowns, for the Radiology
options, Medicine options, and Surgical options, and use a Visibility to
have only 1 of those 3 dropdowns shown at a given time, based on the value
selected in Specialty.

You'll let me know if this works for you.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet

woodsaa

unread,
Feb 3, 2020, 12:01:20 PM2/3/20
to orb...@googlegroups.com
Hi Alex,

Thanks for the reply.

I was trying to avoid this as we have over 30 specialties. This just means I
need to create 30 different dropdown boxes.
Another issue was that we need to populate these responses into a print
letter template and with 30 controls it would not display well formatted.

My solution is to have a hidden calculated field which will pull the value
from the selected specialty using if statements. And then populate the print
letter template with the value from the calculated value so as to fix the
formatting dilemma.


Regards,
Aaron

Alessandro Vernet

unread,
Feb 5, 2020, 2:05:26 PM2/5/20
to orb...@googlegroups.com
Hi Aaron,

Got it, so I'd suggest you create a file that looks like the
`reasons-decline.xml` linked below, and place it in your `config` directory,
along your `properties-local.xml`. Then, in Form Builder, configure a
Dynamic Dropdown as shown in the `dynamic-dropdown-properties.png` linked
below. You can see what this gives at runtime in `running.mp4`. And for
reference, I've attached the source of the form in `form.xml`, which will
work in 2019.2.

You'll let me know if this works for you.

reasons-decline.xml
<http://discuss.orbeon.com/file/t119778/reasons-decline.xml>
dynamic-dropdown-properties.png
<http://discuss.orbeon.com/file/t119778/dynamic-dropdown-properties.png>
running.mp4 <http://discuss.orbeon.com/file/t119778/running.mp4>
form.xml <http://discuss.orbeon.com/file/t119778/form.xml>

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet

Alessandro Vernet

unread,
Feb 12, 2020, 8:08:17 PM2/12/20
to orb...@googlegroups.com
Hi Aaron, did you get a chance to try the technique described in my previous
message, using a single dynamic dropdown? If so, did that work for you?
Reply all
Reply to author
Forward
0 new messages