...
Note |
---|
Unlike the Aptify .NET API, the Aptify JavaScript API does not require the developer to manage the communication between the GE and the UI. If you change a GE field value, that value will change in the UI, and vice versa. This can make it very tempting to implement business logic in a form template layout control. Resist this temptation. Any logic that is not directly dealing with the UI is business logic and should be implemented as such in a client-side GE plugin. |
Step-by-step guide
Retrieving the GE from the main layout control function:
Layout control objects have a function called getGEObject(). Any time you have access to the layout control object, you can simply call getGEObject() on it. If the GE has been loaded, it will be returned.Code Block language js title Directly reference the "this" variable var _ge = this.getGEObject();
...
Code Block language js title Reference an aliased "this" variable var _ftl = this; var _ge = _ftl.getGEObject();
Retrieving the GE from eventData:
Overrideable events on the form template layout receive an object. This object almost always includes a formTemplateLayout property that is the layout control itself, and may also include a geObject property. If the geObject property exists, you can use it directly. Otherwise, you can call getGEObject() on the formTemplateLayout property.Code Block language js title Reference the geObject property in afterLoad // afterLoad() receives an object with the geObject property // This function is registered as overriding afterLoad() function _afterLoad(eventData) { var _ge = eventData.geObject; // do work with the GE }
Code Block language js title Reference the GE through the formTemplateLayout property // beforeLoad() receives an object with a formTemplateLayout property // This function is registered as overriding beforeLoad() function _beforeLoad(eventData) { var _ftl = eventData.formTemplateLayout; var _ge = _ftl.getGEObject(); }
Related articles
Filter by label (Content by label) | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|