Repeated grid counting - problem with XPath ecpresion

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

Repeated grid counting - problem with XPath ecpresion

dominik
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.

--
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/1612187370008-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Repeated grid counting - problem with XPath ecpresion

Jarosław Kowalewski
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

pon., 1 lut 2021 o 20:22 dominik <[hidden email]> napisał(a):
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.

--
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/1612187370008-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/CAHFpwcWzZb1qeri0%2BRoZeZ0kLyAyWCvZCJ1GOiPhU9Ys2TViTw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Repeated grid counting - problem with XPath ecpresion

Alessandro  Vernet
Administrator
In reply to this post by dominik
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/

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

Re: Repeated grid counting - problem with XPath ecpresion

domkur
Works correctly. Thank you so much for help Alex!!

--
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/1612450015150-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Repeated grid counting - problem with XPath ecpresion

Alessandro  Vernet
Administrator
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
--
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/1612683699168-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet