Repeating grids/sections - questions from a novice!

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

Repeating grids/sections - questions from a novice!

Jamian Manton
Hi All,

I'm delving a little deeper into repeating sections and grids and have a couple of questions. I'm hoping someone can enlighten me with answers. We are currently using  2018.1.2.201810050007 PE of Orbeon forms.

1. Is it possible to reference a field in a previous iteration that is used to calculate a field in the following iteration of a repeating section/grid? e.g. weight field on 1st visit (1st iteration) determines weight gain/loss (calculated in 2nd iteration based on weight in 1st iteration - weight in 2nd iteration). If so, I'd appreciate direction to determine what the formula might look like or how to reference a previous iteration.

2. We use appearance="minimal" to have "Add another..." appear at the bottom of a repeating section/grid. Is there a way to alter this text from "Add another" to be more specific to what we are wanting to add, such as Add another visit..., or "Add another child"? We often find we have a collection of Add Another links at the bottom of repeating grids inside a repeating section and this confuses the users.

Thanks,
Regards
Jamian


--
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/d8de2b61-ea2f-441c-96f5-51fe6cabf1e7n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Repeating grids/sections - questions from a novice!

Alessandro  Vernet
Administrator
Hi Jamian,

1. If your weight field is called `weight` (original!), referring to the
value of the field on the same row is simply done with `$weight`. However
the expression is a little more complicated if you want to access the weight
field on the previous row: `../preceding-sibling::*[1]/weight`. And say you
want to show "n/a" if you are on the first row then the expression becomes:

    if (exists(../preceding-sibling::*[1]))
    then $weight - ../preceding-sibling::*[1]/weight
    else 'n/a'

See below for what this would look like at runtime, and for the source of a
form you can paste in Form Builder.

weigh-gain-loss.png
<http://discuss.orbeon.com/file/t119778/weigh-gain-loss.png>  
form.xml <http://discuss.orbeon.com/file/t119778/form.xml>  

2. Unfortunately, at this point this is not customizable, however I added a
plus one from you on the issue #4166 linked below.

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

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

Re: Repeating grids/sections - questions from a novice!

Jamian Manton
Thanks Alex! As always - very responsive and informative!
Regards
Jamian

On Friday, March 19, 2021 at 11:53:20 AM UTC+11 Alessandro Vernet wrote:
Hi Jamian,

1. If your weight field is called `weight` (original!), referring to the
value of the field on the same row is simply done with `$weight`. However
the expression is a little more complicated if you want to access the weight
field on the previous row: `../preceding-sibling::*[1]/weight`. And say you
want to show "n/a" if you are on the first row then the expression becomes:

if (exists(../preceding-sibling::*[1]))
then $weight - ../preceding-sibling::*[1]/weight
else 'n/a'

See below for what this would look like at runtime, and for the source of a
form you can paste in Form Builder.

weigh-gain-loss.png
<http://discuss.orbeon.com/file/t119778/weigh-gain-loss.png>
form.xml <http://discuss.orbeon.com/file/t119778/form.xml>

2. Unfortunately, at this point this is not customizable, however I added a
plus one from you on the issue #4166 linked below.

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

-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/ed93fb11-37c2-4adf-9065-1935db9bc910n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Repeating grids/sections - questions from a novice!

Alessandro  Vernet
Administrator
I'm glad that helped, Jamian, and thank you for the update.

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