Incrementing a variable from inside a repeater does it twice

Hi there,

I’m working on a table interface that allows users to map items from A to B to C. The table has four columns - a reference ID, then three dropdown pickers, one in each column.

If the user selects option A in column 1, then I increment a global variable by firing an OnClick at a widget outside the repeater. If they select option B, I enable the second and third pickers. Selecting some options in these pickers also increments the global variable in the same way, by firing an OnClick at the same widget outside the repeater.

Once the user has selected something in all rows, a button is enabled outside the repeater, based on a count value (if the number of the global variable equals 5, then something has happened in all of the rows and the button can be enabled)

However, when I trigger these OnClicks from inside the repeater, they happen twice - every valid change to a picker increments the variable by 2 instead of 1.

If I move these pickers outside the repeater, they work as expected. Does anyone have any idea why firing an OnClick from inside a repeater to increment a variable does it twice? Is this a bug?

1 Like

I think you’re going to have more luck if you share the file in question, or at least an example of the issue. I can only speak for myself, but it’s very difficult to reconstruct the file in my head in order to figure out what’s wrong.

One thing I’d recommend is to check the Axure console in the sidebar if your prototype. Do you see it firing twice there? Remember that repeaters get updated differently than other widgets and there could be some interaction with the repeater refreshing and however you’re triggering stuff.

Hi nkrisc, thanks very much for your response.

I recreated the repeater with sanitised data in the attached file. I can indeed see it firing twice in the trace sidebar in this document (it’s easier to see here as my actual mockup is huge and is loading multiple variables and interactions on each page).

I think there’s some kind fire-update-fire thing going on here, but I have no idea how to diagnose that.

RepeaterRowVariableExample.rp (76.4 KB)

Still working out how you expect it to work, so maybe I’m off here, but I noticed that essentially you have more things that increment the variable than you have that decrement it. For example, if I switch the last option from “Parent A - Child 1” to “Parent A - Child 2” it increments. If I switch them back again, it increments again. I could switch them all day and infinitely increment the counter. I’m guessing that probably isn’t what you want.

Basically I would look at your logic for incrementing the variable and ensure it’s correct and comprehensive.

Sorry, the example is probably too complex. I’m aware the incrementing isn’t completely foolproof if selections are made twice or changed after first selection.

The issue is based on a single selection action.

If you select the first picker in the the Option Select column, in any row, you’ll see the interaction fire twice and the variable go up by two, as a result of a single user action. That’s the issue I’m trying to resolve.

Interestingly, when I select “Map to parent” in the first picker I see the variable only increment by one. When I select the other option it doesn’t increment at all.

Are you using the latest version of Axure? I’m using 3382 which looks to be the latest:

I’m using 3297, as new versions need to go through an IT approval process.

I’m guessing this might be a version-specific bug in that case.

Small update - I was curious, so I uploaded my test file to Axure Share. It works fine there. So I think it is definitely an old bug in the rendering engine that has likely been fixed. Thanks for your pointers.