Validation in a repeated grid

14 views
Skip to first unread message

Mani

unread,
Mar 18, 2020, 2:27:41 AM3/18/20
to Orbeon Forms
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



repeat grid

Alessandro Vernet

unread,
Mar 18, 2020, 2:52:45 PM3/18/20
to orb...@googlegroups.com
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/

Mani

unread,
Mar 23, 2020, 8:57:36 PM3/23/20
to Orbeon Forms
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?

Alessandro Vernet

unread,
Mar 24, 2020, 6:08:36 PM3/24/20
to orb...@googlegroups.com
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

Alessandro Vernet

unread,
Mar 31, 2020, 12:32:30 PM3/31/20
to orb...@googlegroups.com
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?
Reply all
Reply to author
Forward
0 new messages