Dynamically add / subtract rows from one repeater to another

Hello.

I’m working on a transit fare app prototype. I’ve got a repeater set up with nine types of fare and a “+” / “-” in each to add / subtract that fare type. I’d like to pass on a “summary” of each selected fare to another repeater (actually two other repeaters-but I imagine the process will be the same for both), row by row.

Simple enough-or at least it is after much viewing of the Axure documentation / this forum / video tutorials! Where I’m failing, though, is that each “+” click adds a completely new row-where as I’d like the quantity of already added rows to accumulate rather than go to a new row. And clicking “-”, trying to match some text in the row, is not working as expected. I know (I think) it’s got something to do with filters (something I’ve attempted to apply to the “-” button-but I can’t work out the correct linking / syntax.

File attached. Any help greatly appreciated.

Cheers
PassSelector.rp (83.4 KB)

Hi @BNARob,

Not sure it was the way you had planned to do it but here a version which should work:
PassSelector edited.rp (90.8 KB)

Data are already in Wallet & Summary repeaters:
image

Rows are hidden if quantity = 0, shown else:
image

On [+] and [-] button you don’t add or delete row but only update the quantity:
image

PS: by the way I slighty change the Summary repeater so “Quantity” and “$” is always here and you only have to store the value in the repeater ( e.g. “3” and not “Quantity: 3”)
image

Hope it will help you,
Best,

Hi Pierre. Thanks very much for this-it’s an interesting solution. I think, ultimately, it will do what I wanted-need to plug it all back into a larger project to test, but I think it will work.

Out of curiosity, is this more efficient that adding “$” and “Quantity:” in the string, outside of the expression, ie "Quantity: [[ TargetItem.PassCount ]] ?

Thanks again for your help.

Hello again. One more quick (hopefully!) query…

The spacing of the Summary / Wallet repeaters varies depending on which fares are selected. For example, selecting the first, fourth and seventh fares shows larger spacing than selecting the first, second and third.

Any idea why this would be? What is moving the bottom fares up when made visible?

Thanks

I think it more efficient if you have to trigger conditions (if quantity=0 is less prone to errors than quanty=“Quantity: 0” for instance, but “Quantity: [[ TargetItem.PassCount ]]” works too, so it’s just a preference of mine)

Concerning the spacing, as the rows aren’t deleted, only hidden, the spacing between rows are still applied:
image

So between the a row and another one, the spacing is equal to 6 x number of rows inbetween.

A way to deal with it is to add the spacing directly on the item that is hidden and remove it from the repeater:
image image

Here another version with the spacing in the item:
PassSelector edited spacing.rp (90.2 KB)

Best,
Have a nice day,

Hi. I did think it had something to do with the spacing-have added it into the repeater group, as you suggested.

Still can’t see how the lower rows are being moved up when shown, though. Which function is doing that?

1 Like

Disregard last question: I worked out it’s the “Fit to Content in HML” function.

Thanks for your help

1 Like