Inheriting scripts
As you've just seen, inheriting visual parts enables you to reuse existing work. You can also use inheritance to reuse scripts.
To see this, try the following example. Return to the AddressView part, and add this simple script:
beep
CgDisplay default bell: 20.
Save your work, and then open the Composition Editor on the ReadOnlyAddressView part. Create an event-to-script connection for the form's aboutToCloseWidget event. When the Connect event window opens, the list of scripts is empty.
To find the script that you just wrote, select AddressFormView from the Show methods in class drop-down list.
After the list of script names refreshes, the Connect event window looks as follows:
Connect event window
Select beep from the list of scripts and then select OK.
When you test the parts, you'll notice that the ReadOnlyAddressView window beeps upon closing, while the AddressFormView window does not.
Last modified date: 06/11/2018