Custom Components
Making custom components right in your workspace
UI Generator
/** This sample class gives the format of the UI Generator object
* that is used to construct the main display for a custom control.
* The user should return an object with the below functions to create
* the functionality of the display. All these methods are optional and
* any can safely be omitted. As such, a class does not need to be
* created, any object can be passed in. If the class is used, an
* instance should be returned from the uiGenerator view.
* In the methods listed, outputElement is the HTML element that
* contains the form. The admin argument is an object that contains
* some utilities. See the documentation for a definition. */
var SampleUiGeneratorClass = class {
/** This can be whatever you want. They user will
* return aninstance rather than the class so this is
* called by the user himself, if he even chooses to use
* a class. OPTIONAL */
constructor() {
}
/** This is called when the instance is first compiled into
* the control. Note the output element will exist but it
* may not be showing. The method onLoad will be called when
* the outputElement is loaded into the page. OPTIONAL */
init(outputElement,admin) {
}
/** This method is called when the HTML element (outputElement)
* is loaded onto the page. OPTIONAL */
onLoad(outputElement,admin) {
}
/** This method is called when the HTML element is unloaded
* from the page OPTIONAL */
onUnload(outputElement,admin) {
}
/** This method is the way of passing data into the component.
* The code here can NOT access the other tables because this code
* is not part of our model. This object is just UI code.
* The data passed is the value returned
* from the user input function when the value updates. OPTIONAL */
setData(data,outputElement,admin) {
}
/** This method is used when save is pressed on the coponents save toolbar,
* if applicable. It retreives an data from the control, such as if this is
* an edit table. OPTIONAL */
getData(outputElement,admin) {
}
/** This method is called when the output element resizes.
* OPTIONAL */
onResize(outputElement,admin) {
}
/** This method is called before the window is closed. It should
* return apogeeapp.app.ViewMode.CLOSE_OK if it is OK to close
* this windows. If this function is omitted, it will be assumed
* it is OK to close. An alternate return value is
* apogeeapp.app.ViewMode.UNSAVED_DATA. OPTIONAL */
isCloseOk(outputElement,admin) {
return apogeeapp.app.ViewMode.CLOSE_OK;
}
/** This method is called when the control is being destroyed.
* It allows the user to do any needed cleanup. OPTIONAL. */
destroy(outputElement,admin) {
}
}More Information
Last updated
Was this helpful?