Validation in a repeated grid

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

Validation in a repeated grid

mbojja
Hi Alex, need some help with validation in repeat grid.

I have a case where if in any row/iteration "dropdown = third choice and amount >= 2000" then the comments control in that row/iteration must be made mandatory. 

Thanks



--
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/07d6b1df-30c1-4917-b92a-8c8e2749fd25%40googlegroups.com.

repeat grid (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Validation in a repeated grid

Alessandro  Vernet
Administrator
Hi Manish,

The following expression will do the trick: `$dropdown = '3' and
xs:decimal($amount) > 2000`. You can see the result in the screenshot below,
and I've also attached the updated form with this change. You'll let me know
if this works for you.

runtime.png <http://discuss.orbeon.com/file/t119778/runtime.png>  
form.xml <http://discuss.orbeon.com/file/t119778/form.xml>  

‑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/1584557561111-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Validation in a repeated grid

mbojja
Thanks Alex. Works perfect!

But the drop-down values cannot be selected more than once. Every row must have a unique dropdown value. How do I do that?



On Thursday, March 19, 2020 at 2:52:45 AM UTC+8, Alessandro Vernet wrote:
Hi Manish,

The following expression will do the trick: `$dropdown = '3' and
xs:decimal($amount) > 2000`. You can see the result in the screenshot below,
and I've also attached the updated form with this change. You'll let me know
if this works for you.

runtime.png <<a href="http://discuss.orbeon.com/file/t119778/runtime.png" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2Ffile%2Ft119778%2Fruntime.png\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHcUgF-oBD8aj7WbjgTQwGoMo_CcQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2Ffile%2Ft119778%2Fruntime.png\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHcUgF-oBD8aj7WbjgTQwGoMo_CcQ&#39;;return true;">http://discuss.orbeon.com/file/t119778/runtime.png>  
form.xml <<a href="http://discuss.orbeon.com/file/t119778/form.xml" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2Ffile%2Ft119778%2Fform.xml\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH-kQq86nRhxmeAHNseu9ucWhj7QQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2Ffile%2Ft119778%2Fform.xml\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH-kQq86nRhxmeAHNseu9ucWhj7QQ&#39;;return true;">http://discuss.orbeon.com/file/t119778/form.xml>  

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" 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 https://groups.google.com/d/msgid/orbeon/89fb5d42-2640-440b-90f3-fa0ea2ca2e05%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Validation in a repeated grid

Alessandro  Vernet
Administrator
Hi Manish,

You can use an expression along these lines, and I've also linked to an
updated version of the form below. You'll let me know if this works for you.

    let $current := .
    return count(//dropdown[. = $current]) = 1

form.xml <http://discuss.orbeon.com/file/t119778/form.xml>  

‑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/1585087712116-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Validation in a repeated grid

Alessandro  Vernet
Administrator
Hi Manish, did you get a chance to try the expression checking that the
selected value is different on every row? If so, did that work for you?
‑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/1585672346971-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet