Copy link to clipboard
Copied
I'm creating a drag - drop with an advanced action (object action) counting dropped items that fires when an item is dropped. I also want users to be able to re-drag a mistakenly dropped item to its correct drop zone without sending it back to origin with Undo. My AA calls a javascript that determines correct drops and scoring according to a set of rules. All works fine except that my AA is triggered by simply clicking a dropped item once it is in a drop zone - it does not have to be dragged anywhere. This allows users to run up the counter by repeatedly (and infinitely) clicking one correctly dropped item.
Is there any way to limit firing of the AA to actually dropping an item into a drop zone when redrag is enabled?
The javascript is irrelevant to this issue - just an AA that increments a counter has the same problem.
Thanks for your help.
CP9.0.2.437
You should have posted the advanced action. Avoiding this can be done by not using a unique counter that is incremented, but a different variable for each correct drag action that is toggled from 0 to 1. Once the variable is set to 1, it cannot be incremented. The real counter can always be calculated by summing up the boolean variables, or you can rethink the conditional action.
Copy link to clipboard
Copied
You should have posted the advanced action. Avoiding this can be done by not using a unique counter that is incremented, but a different variable for each correct drag action that is toggled from 0 to 1. Once the variable is set to 1, it cannot be incremented. The real counter can always be calculated by summing up the boolean variables, or you can rethink the conditional action.
Copy link to clipboard
Copied
Thank you for the suggestion of using booleans - that does the trick. Only a few more variables to add to the system and a condition to do nothing if an item is already in the same drop zone as it was before and everything works like a charm.
You're the best!
PS - I didn't post the AA because it's trivial, but here it is anyway.
The javascript hits a clickbox that then totals everything up, shows warnings, etc. Now it looks like the following: