How to control Show/Hide fields at Runtime in Orbeon Form Runner?

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

How to control Show/Hide fields at Runtime in Orbeon Form Runner?

Rahul
I have created a form in orbeon form builder which has three 30 questions which are belongs to 3 categories. Now I don't want to show all the 30 questions to every one also I don't want to create different forms for each category because all these categories belongs to one module.

While adding the form I have a drop down question like "Select Category". If user select the first category then I need to display only first category related questions and hide the second and third category related questions.

Is there any way to achieve my task in Form Runner?
Reply | Threaded
Open this post in threaded view
|

Re: How to control Show/Hide fields at Runtime in Orbeon Form Runner?

MoBIoS
I am pretty new to orbeon myself.
This is what I have figured so far, controlling visibilty of fields, thus creating a conditional dialogue.
In the formular field add the desired boolean xpath expression

# Standard 1 Condition
$controler-name='selected-value'
i.e.
$hardware-type='printer'

chain more conditions wich have to be meet, before a field is shown

# Condition Chain or () and ()
($controler-nameA='seceted-value1') or ($controler-nameA='seceted-value2') or ($controler-nameA='seceted-value3') and ($controler-nameB='seceted-value1')
i.e.
($printer='notreachable') or ($printer='paperjam') or ($printer='tonerempty') and ($hardware-type='printer')

# Show field if anyone of the conditions are meet
xxf:split($controler-name) = 'selected-value1' or  xxf:split($controler-name) = 'selected-value2'

xxf:split($affected-software) = 'word' or xxf:split($affected-software) = 'outlook' or xxf:split($affected-software) = 'excel' or xxf:split($affected-software) = 'all'

Regards,

MoBIoS
Reply | Threaded
Open this post in threaded view
|

Re: How to control Show/Hide fields at Runtime in Orbeon Form Runner?

Alessandro  Vernet
Administrator
In reply to this post by Rahul
Hi Manju,

If you want to hide a condition upon some condition, you can do so by,
in Form Builder, clicking on the "gear icon" to the right of the
section title, and entering an XPath expression under Visibility. As
mentioned by Oliver, the XPath expression can use the value of another
field, e.g. in your case $category = 'gaga', if you only want that
section to be visible if the value from the "category" dropdown is
"gaga".

Alex

On Mon, May 4, 2015 at 7:00 AM, Rahul <[hidden email]> wrote:

> I have created a form in orbeon form builder which has three 30 questions
> which are belongs to 3 categories. Now I don't want to show all the 30
> questions to every one also I don't want to create different forms for each
> category because all these categories belongs to one module.
>
> While adding the form I have a drop down question like "Select Category". If
> user select the first category then I need to display only first category
> related questions and hide the second and third category related questions.
>
> Is there any way to achieve my task in Form Runner?
>
> --
> View this message in context: http://discuss.orbeon.com/How-to-control-Show-Hide-fields-at-Runtime-in-Orbeon-Form-Runner-tp4659865.html
> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.
>
> --
> 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].

--
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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: How to control Show/Hide fields at Runtime in Orbeon Form Runner?

Rahul
In reply to this post by MoBIoS
I have followed your suggestion, I tried testing this feature on default
"contacts" form. I have created a new text field in the contact form named
"Account Related Field" as a label and "control-10" as Control Name. Below
is the screen shot for the same.

<http://discuss.orbeon.com/file/n4659878/pic1.jpg>

Then After that I clicked on control setting of the "Account Related Field"
and under the "Formulas" tab I have added the following Xpath expression in
"Visibility" section. $topic='Account' following is the screenshot.

<http://discuss.orbeon.com/file/n4659878/pic2.jpg>


After adding the path expression I saved the contact form and published.
Then I tried opening the form in form runner. But I am not able to view the
"Account Related Field" field on UI after selecting the "topic" value is
"Account" in the form runner. This is the screenshot of form runner after
publishing form in form builder.

<http://discuss.orbeon.com/file/n4659878/pic3.jpg>

Did I miss something. Please help to resolve the issue. I need to view
"Account Related Field" field only if "topic" field value is "Account"

Thanks in advance.

--
View this message in context: http://discuss.orbeon.com/How-to-control-Show-Hide-fields-at-Runtime-in-Orbeon-Form-Runner-tp4659865p4659878.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

--
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: How to control Show/Hide fields at Runtime in Orbeon Form Runner?

Rahul
In reply to this post by MoBIoS
Thank you. It worked for me.
Reply | Threaded
Open this post in threaded view
|

Re: How to control Show/Hide fields at Runtime in Orbeon Form Runner?

Alessandro  Vernet
Administrator
Hi Manju,

OK, good, I'm glad you got this to work.

Alex

On Wed, May 6, 2015 at 9:59 PM, Rahul <[hidden email]> wrote:

> Thank you. It worked for me.
>
> --
> View this message in context: http://discuss.orbeon.com/How-to-control-Show-Hide-fields-at-Runtime-in-Orbeon-Form-Runner-tp4659865p4659884.html
> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.
>
> --
> 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].

--
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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet