Setting to null values for controls where visibility is false

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

Setting to null values for controls where visibility is false

Seth
I am building form where controls are conditionally visible.  My need is to
remove a stored value if the user modifies the parent control and makes a
control containing data no longer visible.  ex.

control 1 age "Is person over the age of 18" Yes = 1, No = 0;

control 2 guardian visible if $age = 1 guardian "Are you the
parent/guardian?"

The need is that if the user first selects "No" for control age then
provides data in control guardian.  Next the user changes the selection of
control age to "Yes" I need the value of the control guardian which is no
longer visible set to ''


--
Sent from: http://discuss.orbeon.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1581984075634-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Setting to null values for controls where visibility is false

Alessandro  Vernet
Administrator
Hi Seth,

Yes, this would be very useful, and we do have request for enhancement #3152
for this (see link below). I've added a +1 from you!

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

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Setting to null values for controls where visibility is false

Jarosław Kowalewski
Hi,
I met such a case 12 years ago and till now have to work with it.
Maybe it would be nice to have any 'form builder' checkbox but you can fix it now just by using 'simple' XPath expression. 
just in calculated field type something like:
if($myfiled = '1') then . else ''  ('' single quotes means empty string/value)
what will calculated as: if a field is visible ( $myfiled = '1' ) just accept what user typed, otherwise reset to empty value. 
And that's it :) 

//Jarek

śr., 19 lut 2020 o 00:23 Alessandro Vernet <[hidden email]> napisał(a):
Hi Seth,

Yes, this would be very useful, and we do have request for enhancement #3152
for this (see link below). I've added a +1 from you!

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

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/CAHFpwcVK0Q_7k%3D7BZzH%2BB2aUcuDv%2BS9hKcqoyAhrzcmVhDNuRQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Setting to null values for controls where visibility is false

Seth


On Tuesday, February 18, 2020 at 5:33:55 PM UTC-6, Jarek wrote:
Hi,
I met such a case 12 years ago and till now have to work with it.
Maybe it would be nice to have any 'form builder' checkbox but you can fix it now just by using 'simple' XPath expression. 
just in calculated field type something like:
if($myfiled = '1') then . else ''  ('' single quotes means empty string/value)
what will calculated as: if a field is visible ( $myfiled = '1' ) just accept what user typed, otherwise reset to empty value. 
And that's it :) 

//Jarek

śr., 19 lut 2020 o 00:23 Alessandro Vernet <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="3WfmoWJ5CAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ave...@...> napisał(a):
Hi Seth,

Yes, this would be very useful, and we do have request for enhancement #3152
for this (see link below). I've added a +1 from you!

<a href="https://github.com/orbeon/orbeon-forms/issues/3152" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Forbeon%2Forbeon-forms%2Fissues%2F3152\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHnQ20sXP5oGN676tm62ygPTwnEGQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Forbeon%2Forbeon-forms%2Fissues%2F3152\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHnQ20sXP5oGN676tm62ygPTwnEGQ&#39;;return true;">https://github.com/orbeon/orbeon-forms/issues/3152

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">http://discuss.orbeon.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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="3WfmoWJ5CAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">orb...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.nabble.com" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.nabble.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.nabble.com&#39;;return true;">https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/e06d9f98-579a-4e9a-8791-ed69f31e3e56%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Setting to null values for controls where visibility is false

Alessandro  Vernet
Administrator
Hi Seth, I'm not sure if you intended to add something in your previous
message, but only the quoted content of Jarek's message came back in your
answer.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1582154339711-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Setting to null values for controls where visibility is false

Seth
In reply to this post by Jarosław Kowalewski
Hi Jarek and Alessandro,

Thank both of you for the quick and helpful responses.  I am using a multiselect option for the parent so the = option will not work unless I use a large matrix of all possible solutions containing the value(s) I need for the visibility.  I used this XPath for the visibility:

$MyField[contains(text(), '1')] or $MyField[contains(text(), '2')] or $MyField[contains(text(), '3')]

But I am not able to use the same formula in the calculated value?  I may not have the proper syntax. The second issue that is related is getting the formula to work with a dynamic dropdown.  When I have a formula like:

if($MyField[contains(text(), '1')]) then . else if($MyField[contains(text(), '2')]) then . else'' 

Then the dropdown becomes read only and the user cannot modify the dropdown.

I have tried many combinations but not one that has been a legal syntax or produced the results I am aiming to achieve.  Any thoughts?

On Tuesday, February 18, 2020 at 5:33:55 PM UTC-6, Jarek wrote:
Hi,
I met such a case 12 years ago and till now have to work with it.
Maybe it would be nice to have any 'form builder' checkbox but you can fix it now just by using 'simple' XPath expression. 
just in calculated field type something like:
if($myfiled = '1') then . else ''  ('' single quotes means empty string/value)
what will calculated as: if a field is visible ( $myfiled = '1' ) just accept what user typed, otherwise reset to empty value. 
And that's it :) 

//Jarek

śr., 19 lut 2020 o 00:23 Alessandro Vernet <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="3WfmoWJ5CAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ave...@...> napisał(a):
Hi Seth,

Yes, this would be very useful, and we do have request for enhancement #3152
for this (see link below). I've added a +1 from you!

<a href="https://github.com/orbeon/orbeon-forms/issues/3152" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Forbeon%2Forbeon-forms%2Fissues%2F3152\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHnQ20sXP5oGN676tm62ygPTwnEGQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Forbeon%2Forbeon-forms%2Fissues%2F3152\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHnQ20sXP5oGN676tm62ygPTwnEGQ&#39;;return true;">https://github.com/orbeon/orbeon-forms/issues/3152

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">http://discuss.orbeon.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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="3WfmoWJ5CAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">orb...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.nabble.com" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.nabble.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.nabble.com&#39;;return true;">https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/f0ac4342-ff2b-4218-adea-04748708cb2d%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Setting to null values for controls where visibility is false

Jarosław Kowalewski
Hi,
1. You can use the same formula in calculate as in visibility. 
2. Ok i forgot to add you need to explicitly mark field as readonly false() as Form Runner makes calculated fields readonly by default. Not sure what version you use but in 2018.2.1 (bug solved in the newer versions) you have to use dummy formula in readonly field like 1=2.

//Jarek


czw., 20 lut 2020, 00:22 użytkownik Seth Parkhurst <[hidden email]> napisał:
Hi Jarek and Alessandro,

Thank both of you for the quick and helpful responses.  I am using a multiselect option for the parent so the = option will not work unless I use a large matrix of all possible solutions containing the value(s) I need for the visibility.  I used this XPath for the visibility:

$MyField[contains(text(), '1')] or $MyField[contains(text(), '2')] or $MyField[contains(text(), '3')]

But I am not able to use the same formula in the calculated value?  I may not have the proper syntax. The second issue that is related is getting the formula to work with a dynamic dropdown.  When I have a formula like:

if($MyField[contains(text(), '1')]) then . else if($MyField[contains(text(), '2')]) then . else'' 

Then the dropdown becomes read only and the user cannot modify the dropdown.

I have tried many combinations but not one that has been a legal syntax or produced the results I am aiming to achieve.  Any thoughts?

On Tuesday, February 18, 2020 at 5:33:55 PM UTC-6, Jarek wrote:
Hi,
I met such a case 12 years ago and till now have to work with it.
Maybe it would be nice to have any 'form builder' checkbox but you can fix it now just by using 'simple' XPath expression. 
just in calculated field type something like:
if($myfiled = '1') then . else ''  ('' single quotes means empty string/value)
what will calculated as: if a field is visible ( $myfiled = '1' ) just accept what user typed, otherwise reset to empty value. 
And that's it :) 

//Jarek

śr., 19 lut 2020 o 00:23 Alessandro Vernet <[hidden email]> napisał(a):
Hi Seth,

Yes, this would be very useful, and we do have request for enhancement #3152
for this (see link below). I've added a +1 from you!

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

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/f0ac4342-ff2b-4218-adea-04748708cb2d%40googlegroups.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/CAHFpwcUx7EUPA2difWUbN7U3hruVkS5YHVKDWVxcM1xc2veKWQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Setting to null values for controls where visibility is false

Seth
This works perfectly thank you!

On Thursday, February 20, 2020 at 4:19:42 AM UTC-6, Jarek wrote:
Hi,
1. You can use the same formula in calculate as in visibility. 
2. Ok i forgot to add you need to explicitly mark field as readonly false() as Form Runner makes calculated fields readonly by default. Not sure what version you use but in 2018.2.1 (bug solved in the newer versions) you have to use dummy formula in readonly field like 1=2.

//Jarek


czw., 20 lut 2020, 00:22 użytkownik Seth Parkhurst <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="DAp7K1_qAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">seth.p...@...> napisał:
Hi Jarek and Alessandro,

Thank both of you for the quick and helpful responses.  I am using a multiselect option for the parent so the = option will not work unless I use a large matrix of all possible solutions containing the value(s) I need for the visibility.  I used this XPath for the visibility:

$MyField[contains(text(), '1')] or $MyField[contains(text(), '2')] or $MyField[contains(text(), '3')]

But I am not able to use the same formula in the calculated value?  I may not have the proper syntax. The second issue that is related is getting the formula to work with a dynamic dropdown.  When I have a formula like:

if($MyField[contains(text(), '1')]) then . else if($MyField[contains(text(), '2')]) then . else'' 

Then the dropdown becomes read only and the user cannot modify the dropdown.

I have tried many combinations but not one that has been a legal syntax or produced the results I am aiming to achieve.  Any thoughts?

On Tuesday, February 18, 2020 at 5:33:55 PM UTC-6, Jarek wrote:
Hi,
I met such a case 12 years ago and till now have to work with it.
Maybe it would be nice to have any 'form builder' checkbox but you can fix it now just by using 'simple' XPath expression. 
just in calculated field type something like:
if($myfiled = '1') then . else ''  ('' single quotes means empty string/value)
what will calculated as: if a field is visible ( $myfiled = '1' ) just accept what user typed, otherwise reset to empty value. 
And that's it :) 

//Jarek

śr., 19 lut 2020 o 00:23 Alessandro Vernet <[hidden email]> napisał(a):
Hi Seth,

Yes, this would be very useful, and we do have request for enhancement #3152
for this (see link below). I've added a +1 from you!

<a href="https://github.com/orbeon/orbeon-forms/issues/3152" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Forbeon%2Forbeon-forms%2Fissues%2F3152\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHnQ20sXP5oGN676tm62ygPTwnEGQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Forbeon%2Forbeon-forms%2Fissues%2F3152\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHnQ20sXP5oGN676tm62ygPTwnEGQ&#39;;return true;">https://github.com/orbeon/orbeon-forms/issues/3152

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">http://discuss.orbeon.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 view this discussion on the web visit <a href="https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.nabble.com" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.nabble.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.nabble.com&#39;;return true;">https://groups.google.com/d/msgid/orbeon/1582068245901-0.post%40n4.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 <a href="javascript:" rel="nofollow" target="_blank" gdf-obfuscated-mailto="DAp7K1_qAQAJ" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">orb...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/orbeon/f0ac4342-ff2b-4218-adea-04748708cb2d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/orbeon/f0ac4342-ff2b-4218-adea-04748708cb2d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/orbeon/f0ac4342-ff2b-4218-adea-04748708cb2d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/orbeon/f0ac4342-ff2b-4218-adea-04748708cb2d%40googlegroups.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/df30b165-b9a9-4833-be5d-93e8cc928057%40googlegroups.com.