Calculating Sums from multiple repeaters


#1

Hi there,
I’ve reached the end of what I can do myself on this. I’m building a calculator and have a question.

There are three dynamic panels which can be accessed via the + add buttons on the page. These add more tables on the page. I would like the bottom Total Exposure to add up all the numbers in their corresponding columns above (including the new tables when added - ignore BRR & FRR). So far I only have the Loan Advances column adding up.Calculator2.rp (498.2 KB)

Thanks


To sum and subastract values from Inputs
#2

Hi!

You can use the “listener method” to do the summing. A listener is an object inside of the repeater row that you move by 0,0, and then take advantage of the fact that the hotspot’s OnMove event will be executed for each row within the context of each row, so in the OnMove event you can access column values using Item.columnName as well as Item.index. Essentially, you can treat the OnMove event of the listener just as you would treat the repeater’s own OnItemLoad event.

I put a listener into each one of the repeaters that adds each row’s total to GrandTotal. There’s also a hotspot outside of all the repeaters that you move by 0,0 any time you want this sum to be executed. (I put a button there to move it, but you’d probably want to move it when either of the dynamic panels containing repeaters changes states.) This hotspot first sets GrandTotal to 0, and then moves the listeners, but it moves the second and third listeners only if their surrounding dynamic panel is on the Populated state.

Note that I changed all total values to 1 so it’s easier to see if it works!

By the way, if you google “Axure repeater listener” you’ll find lots of forum posts about using this technique.

Live sample

Calculator2.rp (510.3 KB)


#3

Thanks. I’ll check it out. Yesterday I tried something different that worked, but it’s conditional on the tables being interacted with from top to front.


closed #4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.