Redundancy in coding is a criminal offence IMHO.
I have a central file called CommonFunctions.ps1 which include common functions I use within and between all my projects.
It would be great to be able to include events as well.
For example, I am using a suggestion from one of your blogs to have a central $control_Validated event for all controls.
It would be nice to not have to include this event code in all my psf files. i.e the drop down list I use to select the event function for each event would include events from within the psf AND events in a designated 'common' file.
Thanks
David
[PSS 2016] Help to avoid event redundancy
Forum rules
Do not post any licensing information in this forum.
Do not post any licensing information in this forum.
Re: [PSS 2016] Help to avoid event redundancy
While extremely useful and helpful, I can see this taking a bit of time to implement.
That being said, I've added this to the wish list and if anything comes of it I'll be sure to post it here.
That being said, I've added this to the wish list and if anything comes of it I'll be sure to post it here.
DevinL
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: [PSS 2016] Help to avoid event redundancy
Hmm, I would go with that the event handlers should ALWAYS be with the form and all other functions and handlers associated with the particular form.
But there is nothing that keeps you from calling the same validating function from the different event handlers.
That also makes it easier to add specialized validation before or after your stock validation is executed.
But there is nothing that keeps you from calling the same validating function from the different event handlers.
That also makes it easier to add specialized validation before or after your stock validation is executed.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: [PSS 2016] Help to avoid event redundancy
Yes I do call the same $control_Validated event from all the controls within the form.Alexander Riedel wrote:Hmm, I would go with that the event handlers should ALWAYS be with the form and all other functions and handlers associated with the particular form.
But there is nothing that keeps you from calling the same validating function from the different event handlers.
That also makes it easier to add specialized validation before or after your stock validation is executed.
Just that I have about 2 dozen forms and the same $control_Validated is coded in each of them.
Maybe populating $this is an issue?