Updating multiple controls when using HTTP actions in Orbeon Form Builder

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

Updating multiple controls when using HTTP actions in Orbeon Form Builder

Graham May-2
We are currently using Orbeon Forms version 4.1.0.201304182144-PE. We have an Orbeon Form built using the Form Builder which has a couple of interrelated drop down menus which are bound to HTTP Actions.

We have two drop down menus (years and eligible periods) and another amount to pay control.

The natural workflow usage of the form is as follows:
1)    User validated, http action determine eligible years
2)    User selects eligible year, http action determine eligible periods for year
3)    User selects eligible period, http action determine cost

Given the above scenario if a user modifies the year after we have determined a cost in reality we want to invalidate the eligible period and determined amount to pay value.

What is the best approach to update multiple interrelated controls? As far as we can see we have the following options:
1)    Alter all http actions so that they return additional information. At the moment the eligible year’s only returns eligible years however it could be updated to return blank values for eligible periods and amount to pay. We are against this approach as the http service actions have to be modified to cater for the interaction of the form. The http services might be required in other forms so we don’t naturally want to embellish them just for this form.
2)    Use raw xforms so that we can use model view controller. Allowing the eligible periods and amount to pay control to listen to events such as eligible year changed, for which they could respond by invalidating themselves. Or preferably the model could invalidate them. This is probably our preferred option.
3)    Modify the form so that the eligible years and eligible periods are combined together as one control. Effectively we build a new service based on the existing two services. This reduces the amount of items that need to be invalidated however it means that we need to produce a permutation of values in order to populate the combined eligible years and eligible periods.

Maybe there is an additional option that we have yet to figure out? In reality these three controls require a mediator as their usage is closely coupled in this scenario.

Many thanks
Graham

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Updating multiple controls when using HTTP actions in Orbeon Form Builder

Alessandro  Vernet
Administrator
Hi Graham,

Would you be able to use the data-bound select1 for this? See the documentation [1], the source of an example [2], and the live example [3]. From what I understand, it does something very similar to what you are describing. The component has been in part designed to solve issues that happen when you cascade multiple dropdowns, as you do. Is this something that you could use?

[1] http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components/databound-select1
[2] https://github.com/orbeon/orbeon-forms/blob/master/src/resources-packaged/xbl/orbeon/databound-select1/databound-select1-unittest.xhtml
[3] http://demo.orbeon.com/orbeon/xforms-sandbox/sample/xbl/orbeon/databound-select1/databound-select1-unittest

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