When you want to extend or change stock functionality implemented in JavaScript, you should inherit from the stock JS "class".
Writing a client-side plugin that inherits from stock functionality is very similar to writing a stand-alone client-side plugin, with a little extra metadata configuration to make sure Aptify Web still loads the base JavaScript used by your derived JavaScript.
- Figure out the fully-qualified name of the stock functionality you want to inherit from:
GE Plugin: find the Key Value of the existing JavaScript Entity UI Part.
Form Template Layout Control: find the Key Value of the existing JavaScript Layout Control UI Part.
- Form Component
This can sometimes be tricky with stock Form Components. Older "magic" Components do not always have a UI Platform specified in metadata, so we can't always rely on finding the Key Value.First check the metadata on the Form Component record:
If the Form Component has no UI Platform specified, you'll have to figure out what the fully-qualified name is based on the HTML5 metadata generated for a Form Template Part that uses that Form Control.
- Dashboard Component
This can sometimes be tricky with stock Dashboard Components. Older "magic" Components do not always have a UI Platform specified in metadata, so we can't always rely on finding the Key Value.First check the metadata on the Dashboard Component record:
If the Form Component has no UI Platform specified, you'll have to figure out what the fully-qualified name is based on the HTML5 metadata generated for a Dashboard Part that uses that Dashboard Control.
- Start with the JavaScript template code for the type of stock functionality you're overriding.
Near the top of the file, there is a call to Aptify.framework.inheritance.inherit(), i.e.
GE Subclass (Entity Plugin)// Inherit from the Aptify Generic Entity Aptify.framework.inheritance.inherit(this, new Aptify.framework.genericEntity.aptifyGenericEntity());
Layout Control// Inherit from the generic Form Template Layout Aptify.framework.inheritance.inherit(this, new Aptify.framework.formTemplates.UI.layout());
Custom Control (Form Component) and Custom Dashboard Control (Form Component)// Inherit from the generic bound control // Do this even if your control is NOT bound to a specific field. Aptify.framework.inheritance.inherit(this, new Aptify.framework.dataControls.UI.boundControlBase(domElement));
Instead of inheriting from base stock functionality, you need to change that line to inherit from the fully-qualified name you found in Step 1, i.e., if using the fully-qualified names used in the Step 1 examples:
GE Subclass (Entity Plugin)// Inherit from the stock Aptify Persons GE Subclass Aptify.framework.inheritance.inherit(this, new Aptify.applications.persons.personsGE());
Layout Control// Inherit from the stock Aptify Persons Form Template Layout Control Aptify.framework.inheritance.inherit(this, new Aptify.applications.persons.UI.personFormTemplateLayout());
Custom Control (Form Component)// Inherit from the stock Aptify Multi Line Text Box Aptify.framework.inheritance.inherit(this, new Aptify.framework.dataControls.UI.multiLineTextBox(domElement));
Custom Dashboard Control (Dashboard Component)// Inherit from the stock Entity List View Aptify.framework.inheritance.inherit(this, new Aptify.framework.views.UI.entityListView(domElement));
Related articles
Filter by label
There are no items with the selected labels at this time.