Question:
We have a page that loads a new set of repeaters each time we change a member selection. As we move between members, button click event handlers seem to accumulate and run multiple times. We have tried many ways to purge the button and/or to refresh the page with code, but the problem persists. Everything else in our code works fine, and we are able to purge all data and variables each time we select another member. We do not know how to get at the button event handler with code to purge that with each member selection change.
Product:
Wix Editor and Velo Code.
What are you trying to achieve:
We need our button elements within our repeaters to clear their memory each time we refresh the data and variables for a new member selection. So subsequent button clicks do not cause code to run multiple times.
What have you already tried:
We have tried setting buttons to null, deleting session and memory items that pertain to the button elements and/or their repeaters, and various ways to simply refresh the page.
Additional information:
This is a transactional page for a retailer to interact with a consumer. The retailer data remains constant, and the consumer data changes each time the retailer selects a new member account. Everything works fine, except for the replication of button click event handlers.
The actions work fine within each single instance of the page, with the buttons in each repeater item acting without repetition of prior event handlers.
The problem arises when we switch to another member selection on a page. Then, the button event handlers carry the numbers of event handlers and do their actions (albeit correctly) for each button click within each item (more than one time).
If we manually refresh the page in our browser, then this accumulation of event handler triggers does not happen and the buttons work fine. So, we have tried all kinds of ways to cause such a fresh start, but none have worked.
All other purging and refreshing of data, variables, and page elements work fine. Only the button event handler trigger count remains a problem.