Passing parameters to section templates

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

Passing parameters to section templates

mabu
Hi,

Is it possible to pass parameters to section templates?
E.g. I want to create a section template "Person". Depending on the type of the person ("natural person" vs "legal entity") I want to show different input fields. But most of the fields will be the same for both person types.
Can you please give me a hint how to do it best?

thx,
Martin
Reply | Threaded
Open this post in threaded view
|

Re: Passing parameters to section templates

Alessandro  Vernet
Administrator
Hi Martin,

At this point, this is not supported (section templates don't have a configuration). Of course, for the use case you mentioned, you could create two section templates, one for "natural person" and one for "legal entity". But I imagine you wanted to avoid that; if that's the case, the only way right now would be for you to create an XBL component instead of using a section template. Does this make sense?

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

Re: Passing parameters to section templates

mabu
Yes, I wanted to avoid duplicate code. I also thought about writing my own configurable person XBL component and came to the conclusion to give it a try.
In general I think passing parameters to section templates would be a nice feature. Maybe you can think of it for a future release...

Thank you,
Martin
Reply | Threaded
Open this post in threaded view
|

Re: Passing parameters to section templates

Stian Sigvartsen
I would agree with this. We have a need to maintain a "contact details" section template for use in most of our forms. However each of our forms have different requirements for which section template fields are mandatory/optional, so we end up not using the section template.

-Stian


--
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: Passing parameters to section templates

Alessandro  Vernet
Administrator
Hi Stian, Martin,

The use cases you mention do make a lot of sense, and I created an RFE for this:

https://github.com/orbeon/orbeon-forms/issues/1922

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