Skip to content
Reference > AmiScript API > Classes

FormPanel

Definition

FormPanel var = .... ;

Extends

Extended By

None

Description

A visualization Panel of type Form

Method Summary

Owner Name Return Type Description
FormPanel addButtonField(varname, label) FormButtonField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addCheckboxField(varname, label) FormCheckboxField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addColorGradientPickerField(varname, label) FormGradientColorPickerField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addColorPickerField(varname, label) FormColorPickerField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addDateField(varname, label) FormDateField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addDateRangeField(varname, label) FormDateRangeField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addDateTimeField(varname, label) FormDateTimeField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addDivField(varname, label) FormDivField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addFileUploadField(varname, label) FormUploadField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addImageField(varname, label) FormImageField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
Panel addMenu(parentMenuId, position, menuId, display, bold, italic, underline, status, icon, callback) MenuItem Adds a transient menu item. Note the varname will be prefixed with the transient prefix(default is TRANSIENT_).
Example: myPanel.addMenu("", 0, "test_menu", "\"Test Menu\"" ,true,true,true,"\"enabled\"", null,"session.alert("test");");
Panel addMenu(parentMenuId, position, menuId, display, status, callback) MenuItem Adds a transient menu item. Note the varname will be prefixed with the transient prefix(default is TRANSIENT_)
FormPanel addMultiCheckboxField(varname, label) FormMultiCheckboxField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addMultiSelectField(varname, label) FormMultiSelectField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
Panel addPanelNextToMe(position, configuration) DividerPanel Adds a new panel adjacent to this panel by creating a divider portlet. The divider portlet is returned.
FormPanel addPasswordField(varname, label) FormPasswordField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addRadioButtonField(varname, label) FormRadioField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addRangeSliderField(varname, label, min, max, step) FormRangeSliderField Adds a transient Range Slider Field.
Panel addRelationship(relationshipId, targetPanel, title, trigger, whereVarName, whereClause) Relationship Adds a relationship from this panel to a target panel. Only supported on selectable panel types (RealtimeTable, AggTable, Chart, Heatmap, Filter etc). Returns the created Relationship object. Equivalent to the 'Add Relationship' context menu -- no JSON re-import needed. Pass whereVarName (usually 'WHERE') and whereClause directly. For DM-backed targets, source columns use template variables and target columns are bare titles, e.g. whereClause='"${Source_Symbol}" == Symbol'. For realtime targets only, use bare Source_/Target_ variables, e.g. whereClause='Source_Symbol == Target_Symbol'. Column titles are case-sensitive. Relationship is transient; call commitSession() or commitPanel() then saveLayout() to persist.
FormPanel addSelectField(varname, label) FormSelectField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addSliderField(varname, label, min, max, step) FormSliderField Adds a transient Slider Field.
FormPanel addSwitchField(varname, label) FormSwitchField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addTextAreaField(varname, label) FormTextareaField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addTextField(varname, label) FormTextField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addTimeField(varname, label) FormTimeField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addTimeRangeField(varname, label) FormTimeRangeField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addTitleField(varname, label) FormTitleField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel addToggleButtonField(varname, label) FormToggleButtonField Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)
FormPanel alignBottom() Boolean Align fields on a common bottom edge; without a coordinate, the bottommost field's bottom edge. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignBottom(fields) Boolean Align fields on a common bottom edge; without a coordinate, the bottommost field's bottom edge. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignBottom(fields, bottomPx) Boolean Align fields on a common bottom edge; without a coordinate, the bottommost field's bottom edge. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignCenter() Boolean Centre fields on a common vertical line; without a coordinate, the centre of their bounding box. Fields anchored to both side walls are left alone. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignCenter(fields) Boolean Centre fields on a common vertical line; without a coordinate, the centre of their bounding box. Fields anchored to both side walls are left alone. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignCenter(fields, centerXPx) Boolean Centre fields on a common vertical line; without a coordinate, the centre of their bounding box. Fields anchored to both side walls are left alone. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignLeft() Boolean Align fields on a common left edge; without a coordinate, the leftmost field's left edge. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignLeft(fields) Boolean Align fields on a common left edge; without a coordinate, the leftmost field's left edge. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignLeft(fields, leftPx) Boolean Align fields on a common left edge; without a coordinate, the leftmost field's left edge. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignMiddle() Boolean Centre fields on a common horizontal line; without a coordinate, the centre of their bounding box. Fields anchored to both the top and bottom are left alone. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignMiddle(fields) Boolean Centre fields on a common horizontal line; without a coordinate, the centre of their bounding box. Fields anchored to both the top and bottom are left alone. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignMiddle(fields, centerYPx) Boolean Centre fields on a common horizontal line; without a coordinate, the centre of their bounding box. Fields anchored to both the top and bottom are left alone. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignRight() Boolean Align fields on a common right edge; without a coordinate, the rightmost field's right edge. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignRight(fields) Boolean Align fields on a common right edge; without a coordinate, the rightmost field's right edge. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignRight(fields, rightPx) Boolean Align fields on a common right edge; without a coordinate, the rightmost field's right edge. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignTop() Boolean Align fields on a common top edge; without a coordinate, the topmost field's top edge. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignTop(fields) Boolean Align fields on a common top edge; without a coordinate, the topmost field's top edge. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel alignTop(fields, topPx) Boolean Align fields on a common top edge; without a coordinate, the topmost field's top edge. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel autosize() Boolean Lay out and scale every field to fit the panel. Orientation ('vertical' scales width, 'horizontal' scales height, 'auto' infers from the current layout) determines the scaled axis. An optional max caps the scaled dimension (px; <=0 means none). adjustLabels (default true) moves fields with no explicit label side to a top, left-aligned label so they scale cleanly.
FormPanel autosize(orientation) Boolean Lay out and scale every field to fit the panel. Orientation ('vertical' scales width, 'horizontal' scales height, 'auto' infers from the current layout) determines the scaled axis. An optional max caps the scaled dimension (px; <=0 means none). adjustLabels (default true) moves fields with no explicit label side to a top, left-aligned label so they scale cleanly.
FormPanel autosize(orientation, maxScaledPx) Boolean Lay out and scale every field to fit the panel. Orientation ('vertical' scales width, 'horizontal' scales height, 'auto' infers from the current layout) determines the scaled axis. An optional max caps the scaled dimension (px; <=0 means none). adjustLabels (default true) moves fields with no explicit label side to a top, left-aligned label so they scale cleanly.
FormPanel autosize(orientation, maxScaledPx, adjustLabels) Boolean Lay out and scale every field to fit the panel. Orientation ('vertical' scales width, 'horizontal' scales height, 'auto' infers from the current layout) determines the scaled axis. An optional max caps the scaled dimension (px; <=0 means none). adjustLabels (default true) moves fields with no explicit label side to a top, left-aligned label so they scale cleanly.
Panel bringToFront() Object Makes this panel visible and bring its containing window to the front.
Panel callCommand(applicationId, cmdId, arguments) String Calls the given command. Returns commandUid (String) on success, otherwise null.
Panel callCommand(applicationId, cmdId, arguments) String Calls the given command. Returns the commandUid (String) for this command call or null on failure.
Panel callRelationship(relationshipName) Boolean Reruns the relationship targeting this panel based on name. Returns true on success.
Panel callRelationshipId(relationshipId) Boolean Reruns the relationship targeting this panel based on id. Returns true on success.
FormPanel clearErrors() Integer Clears the error message on every field of this form. Returns the number of fields that had one.
Panel clearUserSelection() Object Clears the user's selection.
Panel close() Object Removes this transient panel. Note this will throw an error if the target panel is not transient.
DashboardResource commit() Object Commits transient changes, promoting overrides to persisted values. If transient, makes permanent.
FormPanel countLayoutIssues() Integer How many layout problems inspectFields() found, or null when the panel has no measured size and nothing could be judged.
FormPanel createJsCallback(buttonId, attributes) String Generates javascript that can be embedded in the HTML and used to make callbacks.
Panel deleteMenu(transientMenuId) Boolean Deletes the transient menu item from this panel. Returns true on success, false otherwise.
Panel deletePanel() Object Removes this transient panel. Note this will throw an error if the target panel is not transient
Panel deletePanelWithDm() Object Removes this transient panel along with the associated transient datamodels. Note this will throw an error if the target panel is not transient
FormPanel distributeHorizontally() Boolean Even out the horizontal gaps between fields, holding the leftmost and rightmost still. Needs at least 3 fields to change anything. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel distributeHorizontally(fields) Boolean Even out the horizontal gaps between fields, holding the leftmost and rightmost still. Needs at least 3 fields to change anything. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel distributeVertically() Boolean Even out the vertical gaps between fields, holding the topmost and bottommost still. Needs at least 3 fields to change anything. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel distributeVertically(fields) Boolean Even out the vertical gaps between fields, holding the topmost and bottommost still. Needs at least 3 fields to change anything. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
Panel exportConfig() Map Exports this panel's configuration to a map.
Panel exportConfig(includeRelationships, includeDatamodels) Map Exports this panel's configuration to a map, with the options to include external relationships and external datamodels.
Panel exportConfigIncludeExternalRelationships() Map Exports this panels configuration with external relationships
Panel exportUserPreferences() Map Exports this panel's user preferences to a map.
FormPanel fixLayoutIssues() String Move fields to resolve the overlaps and out-of-panel fields that inspectFields() reports, and return what moved and what was left alone. Fields are only translated, never resized, so a finding no move resolves is reported rather than forced. Does nothing on a panel with no measured size.
Panel focus() Boolean Requests focus on this panel, bringing it to the front if necessary. Returns false if the panel cannot be focused.
DashboardResource getCallback(callbackName) Callback Returns a callback by name
DashboardResource getCallbackNames() List Returns the callback names defined for this dashboard resource. Use session.getDevTools().getCallbackEditor(resource, callbackName) to edit one, and call editor.open() when you want to show the UI.
DashboardResource getCallbacks() Map Returns a map of all callback definitions.
DashboardResource getChildren() List Returns a list of the child dashboard resources.
Object getClassName() String Returns the string name of this object's class type.
Panel getCurrentRelationship() Relationship Returns the Relationship object currently applied to this panel.
DashboardResource getDRI() String Returns the Dashboard Resource Indicator (DRI) as a string. DRI is the unique identifier of an object within the entire dashboard.
DashboardResource getDashboardResourceType() String Returns the Dashboard Resource Type as a string
Panel getDatamodels() List Returns a set of datamodels that were used in this panel.
Panel getDownstreamMode() String Returns status of send data downstream to realtime panels. The statuses are OFF or SELECTED_OR_ALL.
FormPanel getErrors() Map Returns a map of field variable name to error message, containing only the fields that currently have an error.
FormPanel getField(varName) FormField Return the field associate varName, or null.
FormPanel getFieldValue(varName) Object Return the value of the field with the associated varName.
FormPanel getFieldValues() Map Return a map of IDs to values for all fields of this form.
FormPanel getFields() List Returns a list of fields.
FormPanel getFieldsVariableNames() List Returns a list of fields' variable names.
FormPanel getFocusedField() FormField get the HTML for this panel
DashboardResource getFormula(formulaName) Formula Returns a Formula given the formula name.
DashboardResource getFormulaNames() Set Returns a set of the names of all formulas for this object.
DashboardResource getFormulas() Map Returns a map of all available formulas for this object. The key is the formula name.
FormPanel getHtml() String get the HTML for this panel
Panel getId() String Returns this panel's ID (as defined in settings).
DashboardResource getLRI() String Returns the Localized Resource Indicator (LRI) as a string. LRI is the unique identifier of this resource with the parent element.
Panel getLayout() Layout Returns layout that owns this panel.
Panel getLocation() Rectangle Returns a Rectangle object that stores the location of this panel relative to the upper left corner of the browser, not including the 3Forge header.
Panel getMenu() MenuItem Returns this panel's root custom context menu.
DashboardResource getOwner() DashboardResource Returns the DashboardResource that owns this object.
Panel getParent() Panel Returns the parent panel of this panel.
Panel getStyle(styleKey) String Returns the value for a particular style given the style code, which can be obtained by clicking on the style name. Returns Null if key not found.
Panel getStyle(styleKey, index) String Returns the value for a particular style given the style code at the specified position. The style code can be obtained by clicking on the style name. Returns Null if key not found, returns the first value in the list if position is out of bound.
Panel getStyleNumber(styleKey) Number Returns the numeric value associated with the supplied style key in this portlets style. Null if key not found, or value is not a number. Ex: using this method for text align will return null as its values are not numeric.
Panel getStyleSet() StyleSet Returns the StyleSet for this panel.
Panel getTitle() String Returns this panel's title
FormPanel getTransientFields() List Returns a list of transient fields.
Panel getType() String Returns the type of this panel, either: html, div_v, div_h, tabs, or one of the AMI visualization types.
Panel getUid() String Returns this panel's ami-generated ID.
Panel getValue(key) Object Returns the value associated with key from this portlet's attributes. Returns null if key does not exist.
Panel getWindow() Window Returns the window that owns this panel.
FormPanel hasErrors() Boolean Returns true if any field on this form currently has an error message, false otherwise.
FormPanel importField(config) FormField add a transient field to this panel.
FormPanel inspectFields() String Report what is geometrically wrong with this form's field layout: fields whose outer boxes overlap, fields outside the panel, and adjacent fields closer than 8px.
FormPanel inspectFieldsJson() String The field-layout inspection as JSON, including every visible field's rendered outer box (name, left, top, width, height) and the panel size they were measured at.
DashboardResource invokeCallback(callbackName, args) Object Executes the specified callback definition and returns the result from the callback.
Panel isPoppedOut() Boolean Returns true if this panel is popped out.
DashboardResource isTransient() Boolean Returns true if this is transient, false otherwise. Transient objects are not saved to the layout.
Panel isUndocked() Boolean Returns true if this panel is undocked.
Panel isVisible() Boolean Returns true if this panel is visible.
Panel minimize() Object Minimizes the window, same as calling getWindow().minimize().
FormPanel removeField(varname) Boolean Removes a transient field given the field's name.
FormPanel resetFieldPositions() Boolean Reset all fields in form to default positions specified in field editor.
FormPanel resetFields() Boolean Resets the field value to its initial state. For example, a Radio Button field that is set to ON will be reset to its initial state, which is OFF; a Check Box field that is checked will have its box unchecked.
Panel setContextMenuPosition(menuId, position) Boolean Transiently set the position of the context menu item given the supplied menu id. Returns true on success and false otherwise.
Panel setDownstreamMode(mode) String Sets and returns the mode for sending data downstream to realtime panels. The modes are OFF or SELECTED_OR_ALL.
FormPanel setHtml(html) String Set the HTML for this panel, returns old html
Panel setTitle(title) Boolean Sets the title of the panel with the given value
Panel setValue(key, value) Boolean Adds the key value pair to this portlet's attributes and return true if successful.
FormPanel stackHorizontally() Boolean Lay fields out left to right in their current order on a common top edge, each one gapPx after the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel stackHorizontally(fields) Boolean Lay fields out left to right in their current order on a common top edge, each one gapPx after the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel stackHorizontally(fields, startPx) Boolean Lay fields out left to right in their current order on a common top edge, each one gapPx after the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel stackHorizontally(fields, startPx, gapPx) Boolean Lay fields out left to right in their current order on a common top edge, each one gapPx after the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on the named fields only, from an explicit start edge and with an explicit gap. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel stackVertically() Boolean Lay fields out top to bottom in their current order on a common left edge, each one gapPx below the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel stackVertically(fields) Boolean Lay fields out top to bottom in their current order on a common left edge, each one gapPx below the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel stackVertically(fields, startPx) Boolean Lay fields out top to bottom in their current order on a common left edge, each one gapPx below the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
FormPanel stackVertically(fields, startPx, gapPx) Boolean Lay fields out top to bottom in their current order on a common left edge, each one gapPx below the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on the named fields only, from an explicit start edge and with an explicit gap. Positions are measured on the field's outer box - the field plus whatever its label paints outside it
Object toJson() String Returns a string of a json representation of this object.
FormPanel validateFields() Boolean Calls onValidate() on every field of this form in turn, showing the returned message as that field's error or clearing it when nothing is returned. Fields with no onValidate() are left alone, so an error set by setError() is not cleared. A validator that queries a datasource suspends this script until it answers, and a validator that throws fails its field with 'Unexpected Error'. Returns true if every field passed. Equivalent to validateFields(false).
FormPanel validateFields(autofocus) Boolean Calls onValidate() on every field of this form in turn, showing the returned message as that field's error or clearing it when nothing is returned. Fields with no onValidate() are left alone, so an error set by setError() is not cleared. A validator that queries a datasource suspends this script until it answers, and a validator that throws fails its field with 'Unexpected Error'. Returns true if every field passed.

Method Definitions


addButtonField(varname,label)

FormButtonField FormPanel::addButtonField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addCheckboxField(varname,label)

FormCheckboxField FormPanel::addCheckboxField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addColorGradientPickerField(varname,label)

FormGradientColorPickerField FormPanel::addColorGradientPickerField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addColorPickerField(varname,label)

FormColorPickerField FormPanel::addColorPickerField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addDateField(varname,label)

FormDateField FormPanel::addDateField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addDateRangeField(varname,label)

FormDateRangeField FormPanel::addDateRangeField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addDateTimeField(varname,label)

FormDateTimeField FormPanel::addDateTimeField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addDivField(varname,label)

FormDivField FormPanel::addDivField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addFileUploadField(varname,label)

FormUploadField FormPanel::addFileUploadField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addImageField(varname,label)

FormImageField FormPanel::addImageField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addMenu(parentMenuId,position,menuId,display,bold,italic,underline,status,icon,callback)

MenuItem Panel::addMenu(String parentMenuId, Integer position, String menuId, String display, Boolean bold, Boolean italic, Boolean underline, String status, String icon, String callback)

Description

Adds a transient menu item. Note the varname will be prefixed with the transient prefix(default is TRANSIENT_).
Example: myPanel.addMenu("", 0, "test_menu", "\"Test Menu\"" ,true,true,true,"\"enabled\"", null,"session.alert("test");");

Parameter Definition

Name Type Description
parentMenuId String  parent Menu Id
position Integer  position of the transient menu item
menuId String  menu Id
display String 
bold Boolean 
italic Boolean 
underline Boolean 
status String  status("enabled"/"disabled"/"invisible"/"divider")
icon String  menu icon formula
callback String  Amiscript callback to be executed on selected

addMenu(parentMenuId,position,menuId,display,status,callback)

MenuItem Panel::addMenu(String parentMenuId, Integer position, String menuId, String display, String status, String callback)

Description

Adds a transient menu item. Note the varname will be prefixed with the transient prefix(default is TRANSIENT_)

Parameter Definition

Name Type Description
parentMenuId String  parent Menu Id
position Integer  position of the transient menu item
menuId String  menu Id
display String 
status String  status("enabled"/"disabled"/"invisible"/"divider")
callback String  Amiscript callback to be executed on selected

addMultiCheckboxField(varname,label)

FormMultiCheckboxField FormPanel::addMultiCheckboxField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addMultiSelectField(varname,label)

FormMultiSelectField FormPanel::addMultiSelectField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addPanelNextToMe(position,configuration)

DividerPanel Panel::addPanelNextToMe(String position, Map configuration)

Description

Adds a new panel adjacent to this panel by creating a divider portlet. The divider portlet is returned.

Parameter Definition

Name Type Description
position String  Must be either:LEFT,ABOVE,RIGHT,BELOW
configuration Map  if null a blank portlet is created

addPasswordField(varname,label)

FormPasswordField FormPanel::addPasswordField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addRadioButtonField(varname,label)

FormRadioField FormPanel::addRadioButtonField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addRangeSliderField(varname,label,min,max,step)

FormRangeSliderField FormPanel::addRangeSliderField(String varname, String label, Number min, Number max, Number step)

Description

Adds a transient Range Slider Field.

Parameter Definition

Name Type Description
varname String 
label String 
min Number 
max Number 
step Number 

addRelationship(relationshipId,targetPanel,title,trigger,whereVarName,whereClause)

Relationship Panel::addRelationship(String relationshipId, Panel targetPanel, String title, String trigger, String whereVarName, String whereClause)

Description

Adds a relationship from this panel to a target panel. Only supported on selectable panel types (RealtimeTable, AggTable, Chart, Heatmap, Filter etc). Returns the created Relationship object. Equivalent to the 'Add Relationship' context menu -- no JSON re-import needed. Pass whereVarName (usually 'WHERE') and whereClause directly. For DM-backed targets, source columns use template variables and target columns are bare titles, e.g. whereClause='"${Source_Symbol}" == Symbol'. For realtime targets only, use bare Source_/Target_ variables, e.g. whereClause='Source_Symbol == Target_Symbol'. Column titles are case-sensitive. Relationship is transient; call commitSession() or commitPanel() then saveLayout() to persist.

Parameter Definition

Name Type Description
relationshipId String  Unique identifier for the relationship (e.g. "PNL1_to_ALERTS")
targetPanel Panel  The target panel object obtained via layout.getPanel("panelId")
title String  Optional display title; defaults to relationshipId when null/blank.
trigger String  Optional trigger: select
whereVarName String  Optional where variable name. Defaults to WHERE when whereClause is supplied.
whereClause String  Optional where clause. For DM-backed targets use '"${Source_Symbol}" == Symbol'; for realtime targets use 'Source_Symbol == Target_Symbol'. Pass null for no where-clause.

addSelectField(varname,label)

FormSelectField FormPanel::addSelectField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addSliderField(varname,label,min,max,step)

FormSliderField FormPanel::addSliderField(String varname, String label, Number min, Number max, Number step)

Description

Adds a transient Slider Field.

Parameter Definition

Name Type Description
varname String 
label String 
min Number 
max Number 
step Number 

addSwitchField(varname,label)

FormSwitchField FormPanel::addSwitchField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addTextAreaField(varname,label)

FormTextareaField FormPanel::addTextAreaField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addTextField(varname,label)

FormTextField FormPanel::addTextField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addTimeField(varname,label)

FormTimeField FormPanel::addTimeField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addTimeRangeField(varname,label)

FormTimeRangeField FormPanel::addTimeRangeField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addTitleField(varname,label)

FormTitleField FormPanel::addTitleField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

addToggleButtonField(varname,label)

FormToggleButtonField FormPanel::addToggleButtonField(String varname, String label)

Description

Adds a transient field. Not the varname will be prefixed with the transient prefix (default is TRANSIENT_)

Parameter Definition

Name Type Description
varname String 
label String 

alignBottom()

Boolean FormPanel::alignBottom()

Description

Align fields on a common bottom edge; without a coordinate, the bottommost field's bottom edge. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it


alignBottom(fields)

Boolean FormPanel::alignBottom(List fields)

Description

Align fields on a common bottom edge; without a coordinate, the bottommost field's bottom edge. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form

alignBottom(fields,bottomPx)

Boolean FormPanel::alignBottom(List fields, Number bottomPx)

Description

Align fields on a common bottom edge; without a coordinate, the bottommost field's bottom edge. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form
bottomPx Number  bottom edge to align on, in px

alignCenter()

Boolean FormPanel::alignCenter()

Description

Centre fields on a common vertical line; without a coordinate, the centre of their bounding box. Fields anchored to both side walls are left alone. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it


alignCenter(fields)

Boolean FormPanel::alignCenter(List fields)

Description

Centre fields on a common vertical line; without a coordinate, the centre of their bounding box. Fields anchored to both side walls are left alone. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form

alignCenter(fields,centerXPx)

Boolean FormPanel::alignCenter(List fields, Number centerXPx)

Description

Centre fields on a common vertical line; without a coordinate, the centre of their bounding box. Fields anchored to both side walls are left alone. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form
centerXPx Number  vertical centre line to align on, in px

alignLeft()

Boolean FormPanel::alignLeft()

Description

Align fields on a common left edge; without a coordinate, the leftmost field's left edge. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it


alignLeft(fields)

Boolean FormPanel::alignLeft(List fields)

Description

Align fields on a common left edge; without a coordinate, the leftmost field's left edge. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form

alignLeft(fields,leftPx)

Boolean FormPanel::alignLeft(List fields, Number leftPx)

Description

Align fields on a common left edge; without a coordinate, the leftmost field's left edge. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form
leftPx Number  left edge to align on, in px

alignMiddle()

Boolean FormPanel::alignMiddle()

Description

Centre fields on a common horizontal line; without a coordinate, the centre of their bounding box. Fields anchored to both the top and bottom are left alone. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it


alignMiddle(fields)

Boolean FormPanel::alignMiddle(List fields)

Description

Centre fields on a common horizontal line; without a coordinate, the centre of their bounding box. Fields anchored to both the top and bottom are left alone. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form

alignMiddle(fields,centerYPx)

Boolean FormPanel::alignMiddle(List fields, Number centerYPx)

Description

Centre fields on a common horizontal line; without a coordinate, the centre of their bounding box. Fields anchored to both the top and bottom are left alone. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form
centerYPx Number  horizontal centre line to align on, in px

alignRight()

Boolean FormPanel::alignRight()

Description

Align fields on a common right edge; without a coordinate, the rightmost field's right edge. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it


alignRight(fields)

Boolean FormPanel::alignRight(List fields)

Description

Align fields on a common right edge; without a coordinate, the rightmost field's right edge. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form

alignRight(fields,rightPx)

Boolean FormPanel::alignRight(List fields, Number rightPx)

Description

Align fields on a common right edge; without a coordinate, the rightmost field's right edge. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form
rightPx Number  right edge to align on, in px

alignTop()

Boolean FormPanel::alignTop()

Description

Align fields on a common top edge; without a coordinate, the topmost field's top edge. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it


alignTop(fields)

Boolean FormPanel::alignTop(List fields)

Description

Align fields on a common top edge; without a coordinate, the topmost field's top edge. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form

alignTop(fields,topPx)

Boolean FormPanel::alignTop(List fields, Number topPx)

Description

Align fields on a common top edge; without a coordinate, the topmost field's top edge. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form
topPx Number  top edge to align on, in px

autosize()

Boolean FormPanel::autosize()

Description

Lay out and scale every field to fit the panel. Orientation ('vertical' scales width, 'horizontal' scales height, 'auto' infers from the current layout) determines the scaled axis. An optional max caps the scaled dimension (px; <=0 means none). adjustLabels (default true) moves fields with no explicit label side to a top, left-aligned label so they scale cleanly.


autosize(orientation)

Boolean FormPanel::autosize(String orientation)

Description

Lay out and scale every field to fit the panel. Orientation ('vertical' scales width, 'horizontal' scales height, 'auto' infers from the current layout) determines the scaled axis. An optional max caps the scaled dimension (px; <=0 means none). adjustLabels (default true) moves fields with no explicit label side to a top, left-aligned label so they scale cleanly.

Parameter Definition

Name Type Description
orientation String  'vertical', 'horizontal', or 'auto'

autosize(orientation,maxScaledPx)

Boolean FormPanel::autosize(String orientation, Number maxScaledPx)

Description

Lay out and scale every field to fit the panel. Orientation ('vertical' scales width, 'horizontal' scales height, 'auto' infers from the current layout) determines the scaled axis. An optional max caps the scaled dimension (px; <=0 means none). adjustLabels (default true) moves fields with no explicit label side to a top, left-aligned label so they scale cleanly.

Parameter Definition

Name Type Description
orientation String  'vertical', 'horizontal', or 'auto'
maxScaledPx Number  max scaled dimension in px (width if vertical, height if horizontal); <=0 for no cap

autosize(orientation,maxScaledPx,adjustLabels)

Boolean FormPanel::autosize(String orientation, Number maxScaledPx, Boolean adjustLabels)

Description

Lay out and scale every field to fit the panel. Orientation ('vertical' scales width, 'horizontal' scales height, 'auto' infers from the current layout) determines the scaled axis. An optional max caps the scaled dimension (px; <=0 means none). adjustLabels (default true) moves fields with no explicit label side to a top, left-aligned label so they scale cleanly.

Parameter Definition

Name Type Description
orientation String  'vertical', 'horizontal', or 'auto'
maxScaledPx Number  max scaled dimension in px (width if vertical, height if horizontal); <=0 for no cap
adjustLabels Boolean  when true (default), unset labels become top + left-aligned

bringToFront()

Object Panel::bringToFront()

Description

Makes this panel visible and bring its containing window to the front.


callCommand(applicationId,cmdId,arguments)

String Panel::callCommand(String applicationId, String cmdId, Map arguments)

Description

Calls the given command. Returns commandUid (String) on success, otherwise null.

Parameter Definition

Name Type Description
applicationId String 
cmdId String 
arguments Map 

callCommand(applicationId,cmdId,arguments)

String Panel::callCommand(String applicationId, String cmdId, String arguments)

Description

Calls the given command. Returns the commandUid (String) for this command call or null on failure.

Parameter Definition

Name Type Description
applicationId String 
cmdId String 
arguments String  comma delimited list of key=value arguments

callRelationship(relationshipName)

Boolean Panel::callRelationship(String relationshipName)

Description

Reruns the relationship targeting this panel based on name. Returns true on success.

Parameter Definition

Name Type Description
relationshipName String  name of Relationship

callRelationshipId(relationshipId)

Boolean Panel::callRelationshipId(String relationshipId)

Description

Reruns the relationship targeting this panel based on id. Returns true on success.

Parameter Definition

Name Type Description
relationshipId String  Id of Relationship

clearErrors()

Integer FormPanel::clearErrors()

Description

Clears the error message on every field of this form. Returns the number of fields that had one.


clearUserSelection()

Object Panel::clearUserSelection()

Description

Clears the user's selection.


close()

Object Panel::close()

Description

Removes this transient panel. Note this will throw an error if the target panel is not transient.


commit()

Object DashboardResource::commit()

Description

Commits transient changes, promoting overrides to persisted values. If transient, makes permanent.


countLayoutIssues()

Integer FormPanel::countLayoutIssues()

Description

How many layout problems inspectFields() found, or null when the panel has no measured size and nothing could be judged.


createJsCallback(buttonId,attributes)

String FormPanel::createJsCallback(String buttonId, Object ... attributes)

Description

Generates javascript that can be embedded in the HTML and used to make callbacks.

Parameter Definition

Name Type Description
buttonId String  id of the button to execute button press on
attributes Object ...  list of attributes to include

deleteMenu(transientMenuId)

Boolean Panel::deleteMenu(String transientMenuId)

Description

Deletes the transient menu item from this panel. Returns true on success, false otherwise.

Parameter Definition

Name Type Description
transientMenuId String  Transient Menu Id

deletePanel()

Object Panel::deletePanel()

Description

Removes this transient panel. Note this will throw an error if the target panel is not transient


deletePanelWithDm()

Object Panel::deletePanelWithDm()

Description

Removes this transient panel along with the associated transient datamodels. Note this will throw an error if the target panel is not transient


distributeHorizontally()

Boolean FormPanel::distributeHorizontally()

Description

Even out the horizontal gaps between fields, holding the leftmost and rightmost still. Needs at least 3 fields to change anything. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it


distributeHorizontally(fields)

Boolean FormPanel::distributeHorizontally(List fields)

Description

Even out the horizontal gaps between fields, holding the leftmost and rightmost still. Needs at least 3 fields to change anything. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form

distributeVertically()

Boolean FormPanel::distributeVertically()

Description

Even out the vertical gaps between fields, holding the topmost and bottommost still. Needs at least 3 fields to change anything. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it


distributeVertically(fields)

Boolean FormPanel::distributeVertically(List fields)

Description

Even out the vertical gaps between fields, holding the topmost and bottommost still. Needs at least 3 fields to change anything. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form

exportConfig()

Map Panel::exportConfig()

Description

Exports this panel's configuration to a map.


exportConfig(includeRelationships,includeDatamodels)

Map Panel::exportConfig(Boolean includeRelationships, Boolean includeDatamodels)

Description

Exports this panel's configuration to a map, with the options to include external relationships and external datamodels.

Parameter Definition

Name Type Description
includeRelationships Boolean  include external relationships
includeDatamodels Boolean  include external datamodels

exportConfigIncludeExternalRelationships()

Map Panel::exportConfigIncludeExternalRelationships()

Description

Exports this panels configuration with external relationships


exportUserPreferences()

Map Panel::exportUserPreferences()

Description

Exports this panel's user preferences to a map.


fixLayoutIssues()

String FormPanel::fixLayoutIssues()

Description

Move fields to resolve the overlaps and out-of-panel fields that inspectFields() reports, and return what moved and what was left alone. Fields are only translated, never resized, so a finding no move resolves is reported rather than forced. Does nothing on a panel with no measured size.


focus()

Boolean Panel::focus()

Description

Requests focus on this panel, bringing it to the front if necessary. Returns false if the panel cannot be focused.


getCallback(callbackName)

Callback DashboardResource::getCallback(String callbackName)

Description

Returns a callback by name

Parameter Definition

Name Type Description
callbackName String  method name of callback

getCallbackNames()

List DashboardResource::getCallbackNames()

Description

Returns the callback names defined for this dashboard resource. Use session.getDevTools().getCallbackEditor(resource, callbackName) to edit one, and call editor.open() when you want to show the UI.


getCallbacks()

Map DashboardResource::getCallbacks()

Description

Returns a map of all callback definitions.


getChildren()

List DashboardResource::getChildren()

Description

Returns a list of the child dashboard resources.


getClassName()

String Object::getClassName()

Description

Returns the string name of this object's class type.


getCurrentRelationship()

Relationship Panel::getCurrentRelationship()

Description

Returns the Relationship object currently applied to this panel.


getDRI()

String DashboardResource::getDRI()

Description

Returns the Dashboard Resource Indicator (DRI) as a string. DRI is the unique identifier of an object within the entire dashboard.


getDashboardResourceType()

String DashboardResource::getDashboardResourceType()

Description

Returns the Dashboard Resource Type as a string


getDatamodels()

List Panel::getDatamodels()

Description

Returns a set of datamodels that were used in this panel.


getDownstreamMode()

String Panel::getDownstreamMode()

Description

Returns status of send data downstream to realtime panels. The statuses are OFF or SELECTED_OR_ALL.


getErrors()

Map FormPanel::getErrors()

Description

Returns a map of field variable name to error message, containing only the fields that currently have an error.


getField(varName)

FormField FormPanel::getField(String varName)

Description

Return the field associate varName, or null.

Parameter Definition

Name Type Description
varName String  fieldVarName

getFieldValue(varName)

Object FormPanel::getFieldValue(String varName)

Description

Return the value of the field with the associated varName.

Parameter Definition

Name Type Description
varName String  fieldVarName

getFieldValues()

Map FormPanel::getFieldValues()

Description

Return a map of IDs to values for all fields of this form.


getFields()

List FormPanel::getFields()

Description

Returns a list of fields.


getFieldsVariableNames()

List FormPanel::getFieldsVariableNames()

Description

Returns a list of fields' variable names.


getFocusedField()

FormField FormPanel::getFocusedField()

Description

get the HTML for this panel


getFormula(formulaName)

Formula DashboardResource::getFormula(String formulaName)

Description

Returns a Formula given the formula name.

Parameter Definition

Name Type Description
formulaName String  name of the formula to return

getFormulaNames()

Set DashboardResource::getFormulaNames()

Description

Returns a set of the names of all formulas for this object.


getFormulas()

Map DashboardResource::getFormulas()

Description

Returns a map of all available formulas for this object. The key is the formula name.


getHtml()

String FormPanel::getHtml()

Description

get the HTML for this panel


getId()

String Panel::getId()

Description

Returns this panel's ID (as defined in settings).


getLRI()

String DashboardResource::getLRI()

Description

Returns the Localized Resource Indicator (LRI) as a string. LRI is the unique identifier of this resource with the parent element.


getLayout()

Layout Panel::getLayout()

Description

Returns layout that owns this panel.


getLocation()

Rectangle Panel::getLocation()

Description

Returns a Rectangle object that stores the location of this panel relative to the upper left corner of the browser, not including the 3Forge header.


getMenu()

MenuItem Panel::getMenu()

Description

Returns this panel's root custom context menu.


getOwner()

DashboardResource DashboardResource::getOwner()

Description

Returns the DashboardResource that owns this object.


getParent()

Panel Panel::getParent()

Description

Returns the parent panel of this panel.


getStyle(styleKey)

String Panel::getStyle(String styleKey)

Description

Returns the value for a particular style given the style code, which can be obtained by clicking on the style name. Returns Null if key not found.

Parameter Definition

Name Type Description
styleKey String  the key associated with this portlet's style

getStyle(styleKey,index)

String Panel::getStyle(String styleKey, Number index)

Description

Returns the value for a particular style given the style code at the specified position. The style code can be obtained by clicking on the style name. Returns Null if key not found, returns the first value in the list if position is out of bound.

Parameter Definition

Name Type Description
styleKey String  the key associated with this portlet's style
index Number  If the style is a list, which element in the list to return

getStyleNumber(styleKey)

Number Panel::getStyleNumber(String styleKey)

Description

Returns the numeric value associated with the supplied style key in this portlets style. Null if key not found, or value is not a number. Ex: using this method for text align will return null as its values are not numeric.

Parameter Definition

Name Type Description
styleKey String  the key associated with this portlet's style

getStyleSet()

StyleSet Panel::getStyleSet()

Description

Returns the StyleSet for this panel.


getTitle()

String Panel::getTitle()

Description

Returns this panel's title


getTransientFields()

List FormPanel::getTransientFields()

Description

Returns a list of transient fields.


getType()

String Panel::getType()

Description

Returns the type of this panel, either: html, div_v, div_h, tabs, or one of the AMI visualization types.


getUid()

String Panel::getUid()

Description

Returns this panel's ami-generated ID.


getValue(key)

Object Panel::getValue(String key)

Description

Returns the value associated with key from this portlet's attributes. Returns null if key does not exist.

Parameter Definition

Name Type Description
key String 

getWindow()

Window Panel::getWindow()

Description

Returns the window that owns this panel.


hasErrors()

Boolean FormPanel::hasErrors()

Description

Returns true if any field on this form currently has an error message, false otherwise.


importField(config)

FormField FormPanel::importField(Map config)

Description

add a transient field to this panel.

Parameter Definition

Name Type Description
config Map  the field's config, see FormField::exportConfig()

inspectFields()

String FormPanel::inspectFields()

Description

Report what is geometrically wrong with this form's field layout: fields whose outer boxes overlap, fields outside the panel, and adjacent fields closer than 8px.


inspectFieldsJson()

String FormPanel::inspectFieldsJson()

Description

The field-layout inspection as JSON, including every visible field's rendered outer box (name, left, top, width, height) and the panel size they were measured at.


invokeCallback(callbackName,args)

Object DashboardResource::invokeCallback(String callbackName, Object ... args)

Description

Executes the specified callback definition and returns the result from the callback.

Parameter Definition

Name Type Description
callbackName String  method name of callback
args Object ...  arguments

isPoppedOut()

Boolean Panel::isPoppedOut()

Description

Returns true if this panel is popped out.


isTransient()

Boolean DashboardResource::isTransient()

Description

Returns true if this is transient, false otherwise. Transient objects are not saved to the layout.


isUndocked()

Boolean Panel::isUndocked()

Description

Returns true if this panel is undocked.


isVisible()

Boolean Panel::isVisible()

Description

Returns true if this panel is visible.


minimize()

Object Panel::minimize()

Description

Minimizes the window, same as calling getWindow().minimize().


removeField(varname)

Boolean FormPanel::removeField(String varname)

Description

Removes a transient field given the field's name.

Parameter Definition

Name Type Description
varname String  the field's name

resetFieldPositions()

Boolean FormPanel::resetFieldPositions()

Description

Reset all fields in form to default positions specified in field editor.


resetFields()

Boolean FormPanel::resetFields()

Description

Resets the field value to its initial state. For example, a Radio Button field that is set to ON will be reset to its initial state, which is OFF; a Check Box field that is checked will have its box unchecked.


setContextMenuPosition(menuId,position)

Boolean Panel::setContextMenuPosition(String menuId, Integer position)

Description

Transiently set the position of the context menu item given the supplied menu id. Returns true on success and false otherwise.

Parameter Definition

Name Type Description
menuId String  Menu Id
position Integer  Position to set

setDownstreamMode(mode)

String Panel::setDownstreamMode(String mode)

Description

Sets and returns the mode for sending data downstream to realtime panels. The modes are OFF or SELECTED_OR_ALL.

Parameter Definition

Name Type Description
mode String 

setHtml(html)

String FormPanel::setHtml(String html)

Description

Set the HTML for this panel, returns old html

Parameter Definition

Name Type Description
html String 

setTitle(title)

Boolean Panel::setTitle(String title)

Description

Sets the title of the panel with the given value

Parameter Definition

Name Type Description
title String 

setValue(key,value)

Boolean Panel::setValue(String key, Object value)

Description

Adds the key value pair to this portlet's attributes and return true if successful.

Parameter Definition

Name Type Description
key String 
value Object 

stackHorizontally()

Boolean FormPanel::stackHorizontally()

Description

Lay fields out left to right in their current order on a common top edge, each one gapPx after the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it


stackHorizontally(fields)

Boolean FormPanel::stackHorizontally(List fields)

Description

Lay fields out left to right in their current order on a common top edge, each one gapPx after the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form

stackHorizontally(fields,startPx)

Boolean FormPanel::stackHorizontally(List fields, Number startPx)

Description

Lay fields out left to right in their current order on a common top edge, each one gapPx after the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form
startPx Number  left edge to start from, in px

stackHorizontally(fields,startPx,gapPx)

Boolean FormPanel::stackHorizontally(List fields, Number startPx, Number gapPx)

Description

Lay fields out left to right in their current order on a common top edge, each one gapPx after the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on the named fields only, from an explicit start edge and with an explicit gap. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form
startPx Number  start edge in px
gapPx Number  px between fields; default 8

stackVertically()

Boolean FormPanel::stackVertically()

Description

Lay fields out top to bottom in their current order on a common left edge, each one gapPx below the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on every field of the form. Positions are measured on the field's outer box - the field plus whatever its label paints outside it


stackVertically(fields)

Boolean FormPanel::stackVertically(List fields)

Description

Lay fields out top to bottom in their current order on a common left edge, each one gapPx below the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on the named fields only. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form

stackVertically(fields,startPx)

Boolean FormPanel::stackVertically(List fields, Number startPx)

Description

Lay fields out top to bottom in their current order on a common left edge, each one gapPx below the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on the named fields only, against an explicit coordinate. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form
startPx Number  top edge to start from, in px

stackVertically(fields,startPx,gapPx)

Boolean FormPanel::stackVertically(List fields, Number startPx, Number gapPx)

Description

Lay fields out top to bottom in their current order on a common left edge, each one gapPx below the previous. Sizes are preserved -- use autosize() to scale them to the panel. Operates on the named fields only, from an explicit start edge and with an explicit gap. Positions are measured on the field's outer box - the field plus whatever its label paints outside it

Parameter Definition

Name Type Description
fields List  field variable names; null or empty for every field on the form
startPx Number  start edge in px
gapPx Number  px between fields; default 8

toJson()

String Object::toJson()

Description

Returns a string of a json representation of this object.


validateFields()

Boolean FormPanel::validateFields()

Description

Calls onValidate() on every field of this form in turn, showing the returned message as that field's error or clearing it when nothing is returned. Fields with no onValidate() are left alone, so an error set by setError() is not cleared. A validator that queries a datasource suspends this script until it answers, and a validator that throws fails its field with 'Unexpected Error'. Returns true if every field passed. Equivalent to validateFields(false).


validateFields(autofocus)

Boolean FormPanel::validateFields(Boolean autofocus)

Description

Calls onValidate() on every field of this form in turn, showing the returned message as that field's error or clearing it when nothing is returned. Fields with no onValidate() are left alone, so an error set by setError() is not cleared. A validator that queries a datasource suspends this script until it answers, and a validator that throws fails its field with 'Unexpected Error'. Returns true if every field passed.

Parameter Definition

Name Type Description
autofocus Boolean  If true, put the cursor in the first field that failed.