Skip to Content
1
Jul 21, 2023 at 07:41 AM

MDK - Event triggered multiple times because of redraw

155 Views

Hello MDK- Team and Experts,

I have noticed that if there is a button in a section of the MDK app which gets refreshed using redraw, when this button is pressed, the event handler added for OnPress is triggered multiple times. Any new redraw will add a new subscription to this event.

We are using MDK version 23.4 and we have this issue in several places. This affects the functionality of the apps. We need redraw so that the page reacts to changes of flags and the proper data is displayed in the page.

  • Can this "refresh" be performed in a way that doesn't register the event again?
  • Is there any other way to refresh the content of a section without using redraw?
  • Is there any way to identify based on some flags (maybe from clientAPI) if the button was pressed by the actual user and not something triggered automatically?
  • Can you somehow "unsubscribe" the event handler before redraw and then register it back?

Any help/suggestions are highly appreciated.

Thank you,

Anca