Re-populate dynamic drop down values

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Re-populate dynamic drop down values

Karthi
Hi,

Is there a way to dynamically add or remove an item from 'dynamic drop down' control?
A radio button selection should trigger this add or remove item from drop down.
I am using Orbeon form builder to design this form.

Since this drop down is already 'dynamic' and the content is loaded from a server resource url, one possible option could be to attach an 'Action' that uses a 'HTTP Service' that takes radio selection as a request payload and on successful call re-populate the dynamic drop down values .

But this requires an additional server call being made each time the radio option is selected. Do we have any other option?

Thanks in advance !!!
Reply | Threaded
Open this post in threaded view
|

Re: Re-populate dynamic drop down values

Alessandro  Vernet
Administrator
Hi Karthi,

So you'd like the list of choices to be coming from a service, but some of those choices to be available or not based on what the user selected in another radio button? Would you be able to give us an example of such a situation, so we can better visualize it?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re-populate dynamic drop down values

Karthi
Hi Alex,

We have 3 controls in a section.
Radio button group (request type), File upload, and document type drop down.

The 'document types' drop down values are constrained for a 'request type', so we need to populate the drop down values based on 'request type' selection.

Hope this helps.

Thanks,
Reply | Threaded
Open this post in threaded view
|

Re: Re-populate dynamic drop down values

Alessandro  Vernet
Administrator
Hi Karthi,

So you have 3 controls:

- Request type: radio button.
- File upload.
- Document type: dropdown, possible values depend on request type.

I think you already populate the document type with a service+action. I'd suggest you pass to that service the current request type, and run the action on the request type changing and form load. This way, it is up to the service to return the appropriate possible document types depending on the selected request type. Would this work for you?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re-populate dynamic drop down values

Karthi
Hi Alex,
Thanks, we are using the 'Database Service' + 'Action' combination to populate this value.

thanks !!!
Reply | Threaded
Open this post in threaded view
|

Re: Re-populate dynamic drop down values

Alessandro  Vernet
Administrator
Hi Karthi,

Excellent, I'm glad that worked, and thanks for the update.

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