Repeated grid counting - problem with XPath ecpresion

49 views
Skip to first unread message

dominik

unread,
Feb 1, 2021, 2:22:04 PM2/1/21
to orb...@googlegroups.com
Hallo. I've asked this question on stack overflow forum but the proposed solution doesn't work. Maybe I didn't describe enough my problem, so I decided to clarify and ask again on this forum. I need to build a form that will include a mechanism that will allow counting the number of repeating grid, and the final count will be passed in control outside the repeating grid. I can't just use count ($ control) expresion because by default the repetition grids in the form are covered and outside control should show 0. Counting should start after uncover repeated grid by checking checkbox. I expect 0 in controls on right. In tgis step firm works correct. Below is the expression I had got from you to reach expected effect but the counting doesn't start (screen). if ($ checkbox / string () = 'true') then count ($ first-name) 0 more It thi step is ok. No counting. Still 0. I tried to change the data type settings in checkbox and x cells in different configurations (String, Inteher). Nothing has changed. Where is the problem?

Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

Jarosław Kowalewski

unread,
Feb 1, 2021, 5:15:46 PM2/1/21
to orb...@googlegroups.com
Hi,
maybe will help xs:string($mycheckbox) = 'true'. Of course if you really have 'value' = 'true' in your XML model. 
but better compare it in a better way. 
If your control binds to type xs:boolean or xf:boolean you can compare the value with true()/false() 
image.png

if($mycheckbox = true()) then 'box is checked' else 'box is not checked'

//Jarek

--
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 orbeon+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1612187370008-0.post%40n4.nabble.com.

Alessandro Vernet

unread,
Feb 2, 2021, 3:41:14 PM2/2/21
to orb...@googlegroups.com
Hi Dominik,

In addition to what Jarek just mentioned, I've also updated my answer to
your question on Stack Overflow to include the source of a form so you can
use to test this, and a GIF of the result (so we can be sure we're talking
about the same thing!).

https://stackoverflow.com/questions/65847433

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

domkur

unread,
Feb 4, 2021, 11:22:43 PM2/4/21
to orb...@googlegroups.com
Works correctly. Thank you so much for help Alex!!

Alessandro Vernet

unread,
Feb 7, 2021, 2:41:42 AM2/7/21
to orb...@googlegroups.com
Perfect Dominik, I'm glad this worked for you, and thank you as well for the
confirmation,

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply all
Reply to author
Forward
0 new messages