Copy component does not copy associated trigger code

Posted by jmls on 26-Jul-2008 15:02

If I have (for example) a ultrabutton with some trigger code (on_click) defined, if I copy and paste it in the form, the new button does not have the trigger code.

Is this expected and desired, or a bug (if so, I'll raise one)

All Replies

Posted by Shelley Chase on 28-Jul-2008 13:03

Hi Julian,

This is intentional although I agree that some times the behavior you are describing is desirable especially if there are a lot of event subscriptions on the control(s) being copied.

This current behavior is actually due to the clipboard format that .NET controls support. That format does not include any event information. And as such you will see the same behavior in Visual Studio.

-Shelley

Posted by Admin on 28-Jul-2008 13:23

Let me add a note on that. With event on .NET controls it's far more natural to use the same event handler for multiple controls.

When copying controls, would you want a copy of the event handling method or just a second subscription for this? It can't be obvious.

Among other interesting things during this past Exchange I've learned that .NET Controls can actually be copied from one .NET development environment to another one - even when the language changes. So you can copy a C# design to an ABL form. Cool! But don't expect that the source code of events will ever get translated.

Posted by jmls on 28-Jul-2008 15:48

Thanks for the insight. I'll not report a bug then

This thread is closed