Duplicate Event Handlers

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
matthmsft
Posts: 16
Joined: Mon Apr 17, 2017 7:11 pm

Duplicate Event Handlers

Post by matthmsft » Fri Sep 06, 2019 4:38 am

Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.167
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.18362.0

Crazy thing has just started happening. In a form on my project, I have started getting prompts for missing event handlers for buttons and lists and would I like to create them. The odd thing is, the code for the event handlers is still there! and when I click to Add them, it creates duplicates, so I have 3 of a particular event handler ($btn_CredentialAdd_Click - for example).

Has anyone seen this behaviour?

User avatar
matthmsft
Posts: 16
Joined: Mon Apr 17, 2017 7:11 pm

Re: Duplicate Event Handlers

Post by matthmsft » Fri Sep 06, 2019 4:46 am

This is super crazy, even once I click to create them and they are duplicated, if I go back to the Designer view, the popups appear again that the events are missing still and it creates even more!

Some reference must be corrupted or broken somewhere. Any ideas?

User avatar
matthmsft
Posts: 16
Joined: Mon Apr 17, 2017 7:11 pm

Re: Duplicate Event Handlers

Post by matthmsft » Fri Sep 06, 2019 5:05 am

duplicates.PNG
duplicates.PNG (69.15 KiB) Viewed 446 times
Here are the duplicates being generated each time I click into Designer view. The original event handlers with code is still in place further up the project!

User avatar
brittneyr
Site Admin
Posts: 162
Joined: Thu Jun 01, 2017 7:20 am

Re: Duplicate Event Handlers

Post by brittneyr » Fri Sep 06, 2019 7:05 am

What kind of project are you using? (Multi-Form Project, Form Project, etc)
Is it only this form affected by this behavior?
Can you please upload the form with this behavior to the following location:
https://www.sapien.com/support/upload
Brittney Ryn
SAPIEN Technologies, Inc.

User avatar
matthmsft
Posts: 16
Joined: Mon Apr 17, 2017 7:11 pm

Re: Duplicate Event Handlers

Post by matthmsft » Fri Sep 06, 2019 7:11 am

Hi
It is only this form which does it. It is a multi-form project. I have uploaded the form.

Thanks!

User avatar
brittneyr
Site Admin
Posts: 162
Joined: Thu Jun 01, 2017 7:20 am

Re: Duplicate Event Handlers

Post by brittneyr » Fri Sep 06, 2019 8:07 am

I'm able to replicate the behavior you are experiencing with the form you uploaded, but I haven't been able to reproduce this on my own form. I will keep investigating and I'll post if I get any new information.
Brittney Ryn
SAPIEN Technologies, Inc.

User avatar
brittneyr
Site Admin
Posts: 162
Joined: Thu Jun 01, 2017 7:20 am

Re: Duplicate Event Handlers

Post by brittneyr » Fri Sep 06, 2019 9:31 am

From looking at your form, I can see you are missing some closing braces. This seems be what is causing the weird behavior with the designer.
Some that I found:
- Line 1205
- Line 1866
Brittney Ryn
SAPIEN Technologies, Inc.

User avatar
matthmsft
Posts: 16
Joined: Mon Apr 17, 2017 7:11 pm

Re: Duplicate Event Handlers

Post by matthmsft » Fri Sep 06, 2019 1:33 pm

Hi

Thanks, I didn't see the 1205 brace but I see the 1866. That was re-jigged before the problem started, but the syntax highlighter didn't catch it.

I have added the 1866 curly brace and the problem seems to have stopped now.

Seems to be that 1 curly brace that the highlighter missed that cause the behavior to start :)

Great catch.