Dynamically enable/disable "changed" Event handlers? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Dynamically enable/disable "changed" Event handlers?

Last post 09-12-2018 07:02 AM by Th Calu. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-29-2016 01:09 PM

    Dynamically enable/disable "changed" Event handlers?

    Does anyone know if there's a way to programmatically enable/disable "Changed" event handlers in VB? I have a form with 11 repeating sections that are built out using VB loops. Each time a row is added, my "Changed" event handlers get triggered. Although the first line of the "Changed" event sub is an "if not (flag) then return" which stops the Changed event at the first line of the sub, it still slows down my code execution. With the event handlers enabled I'm averaging ~142 seconds to execute my loops. With the event handlers disabled, I'm averaging 80 seconds. Big difference when you're waiting for the form to build out and be usable.

    I have already tried moving "AddHandler" and "RemoveHandler" outside of the Startup method and received error messages for such. Was wondering if anyone else knew of some tricks to stop these change events from triggering?
  • 09-12-2018 02:15 AM In reply to

    • Th Calu
    • Not Ranked
      Male
    • Joined on 06-07-2018
    • France
    • Posts 4

    Re: Dynamically enable/disable "changed" Event handlers?

    Hello, did somebody find a solution ?
  • 09-12-2018 04:44 AM In reply to

    Re: Dynamically enable/disable "changed" Event handlers?

    I haven't found a solution as of yet. I just use a global flag and if it's not true I exit the procedure.
  • 09-12-2018 07:02 AM In reply to

    • Th Calu
    • Not Ranked
      Male
    • Joined on 06-07-2018
    • France
    • Posts 4

    Re: Dynamically enable/disable "changed" Event handlers?

    Thanks for your quick answer.... At this time, I did like you (using a global flag), but It's not a perfect solution against events bubbling, performances etc... I try with delegate, addhandler/removehandler, syntax of InfoPath 2003 etc... without any succes :(
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.