Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

  1. 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
    languagejs
    titleDirectly reference the "this" variable
    var _ge = this.getGEObject(); 

...

  1. Code Block
    languagejs
    titleReference an aliased "this" variable
    var _ftl = this;
    var _ge = _ftl.getGEObject();


  2. 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
    languagejs
    titleReference 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
    languagejs
    titleReference 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();
    }

Filter by label (Content by label)
showLabelsfalse
max5
spacesPKWRK
sortmodified
showSpacefalse
reversetrue
typepage
labelsaptify-javascript-api generic-entity javascript form-template-layout