Skip to content

Properties Controller

Common Properties Controller API

propertyId

const propertyId = {
  name: {parameter name defined in operator definition},
  row: {row in table/array}, // optional when col not set
  col: {col in table}, // optional
  propertyId: {propertyId of the nested structure} // optional
}

Property methods

/*
 * options - optional object of config options where:
 *   setDefaultValues (boolean): when set to true, set default values from parameter definition
 */
setPropertyValues(values, options)
updatePropertyValue(propertyId, value)

/*
 * options - optional object of config options where:
 *   filterHiddenDisabled (boolean): when set to true, filter out data values with a state of disabled or hidden
 *   filterHiddenControls (boolean): when set to true, filter out data values having control type hidden
 *   applyProperties (boolean): when set to true, will return data values in the format expected by the `applyPropertyChanges` callback. If unset or false, will return the internal format used by Common Properties.
 */
getPropertyValue(propertyId, options)

/*
 * options - optional object of config options where:
 *   filterHiddenDisabled (boolean): when set to true, filter out data values with a state of disabled or hidden
 *   filterHiddenControls (boolean): when set to true, filter out data values having control type hidden
 *   applyProperties (boolean): when set to true, will return data values in the format expected by the `applyPropertyChanges` callback. If unset or false, will return the internal format used by Common Properties.
 */
getPropertyValues(options)

Message methods

/*
 * Returns current list of error messages
 * @filteredPipeline (boolean) optional
 * @filterHiddenDisable (boolean) optional. If true, will not return error messages from controls that are hidden or disabled
 * @filterDisplayError (boolean) optional. If true, will not return error messages that are not displayed in the editor
 * when filteredPipeline=true returns enabled/visible control messages and only 1 per control.
 */
getAllErrorMessages()
getErrorMessages(filteredPipeline, filterHiddenDisable, filterSuccess, filterDisplayError = true)
getErrorMessage(propertyId, filterHiddenDisable = false, filterSuccess = false, filterDisplayError = true)
getRequiredErrorMessages()
setErrorMessages(messages)
updateErrorMessage(propertyId, message)

State methods (disable/enabled & hidden/visible)

getControlState(propertyId)
getControlStates()
setControlStates(states)

/*
 * @propertyId - see above
 * @state - valid values are "enabled", "disabled", "visible", "hidden"
 */
updateControlState(propertyId, state)

DatasetMetadata methods

getDatasetMetadata()

/*
 * @datasetMetadata - see [schema](https://github.com/elyra-ai/pipeline-schemas/blob/master/common-pipeline/datarecord-metadata/datarecord-metadata-v1-schema.json)
 */
setDatasetMetadata(datasetMetadata)

Row selection methods

/*
 * Returns table row selection indices as an array of integers.
 * @propertyId - see above
 */
getSelectedRows(propertyId)

/*
 * Updates table row selections for the given table control.
 * @propertyId - see above
 * @selection - A zero-based array of integer selection indices
 */
updateSelectedRows(propertyId, selection)

/*
 * Clears selected table rows for the given table.
 * @propertyId - see above
 * If the propertyId is omitted all table row selections are cleared
 */
clearSelectedRows(propertyId)

/*
 * Adds a row selection listener for a table or list.
 * @propertyId - see above
 * @listener - callback function for when a selection is made in the table or list
 */
addRowSelectionListener(propertyId, listener)

/*
 * Removes the row selection listener from a table or list.
 * @propertyId - see above
 */
removeRowSelectionListener(propertyId)

Validation methods

/*
 * Runs validation conditions on all controls
 */
validatePropertiesValues()

/*
 * Validates a specific propertyId
 * @propertyId - see above
 */
validateInput(propertyId)

Control methods

/*
 * Update the enum values for a given control.  Used when enum values aren't static
 * @propertyId - see above
 * @valuesObj (array) [{ value: <string, number, boolean> , label: "<string>" }]
 */
updateControlEnumValues(propertyId, valuesObj)

General methods

/*
 * Returns the current size of the RHS flyout.
 */
getEditorSize()

/*
 * Sets default property values from parameter definition in the propertiesController.
 * Note - These values won't be displayed on the UI. Host applications can call getPropertyValues() to retrieve the values.
 * @paramDef - Follows the format of https://github.com/elyra-ai/pipeline-schemas/blob/master/common-canvas/parameter-defs/parameter-defs-v3-schema.json
 */
setParamDef(paramDef)

/*
 * Returns the id of top-level active tab or accordion
 */
getTopLevelActiveGroupId()

/*
 * Makes the passed in groupId active.  Only works for top-level groups
 */
setTopLevelActiveGroupId(groupId)

Disable move row buttons methods

/*
 * Disable table row move buttons for all propertyIds in given array
 * @param propertyIds Array of propertyIds
 *
 */
setDisableRowMoveButtons(propertyIds)

/*
 * Returns array of propertyIds for which row move buttons will be disabled
 *  @return Array of propertyIds
 */
getDisableRowMoveButtons()

/*
 * Check if row move buttons should be disabled for given propertyId
 * @param propertyId  The unique property identifier
 * @return boolean
 */
isDisableRowMoveButtons(propertyId)

Custom panel and control methods

/*
 * Only used in custom panel to allow for custom property summary values to be displayed
 * Displays the value set in propertiesReducer for that parameter
 * @propertyId - see above
 * @label (string)
 * @inSummary (boolean)
 */
setControlInSummary(propertyId, label, inSummary)

/*
 * Sets the content to be displayed in the summaryPanel for a customPanel property.
 * The summary panel will directly display the content.
 * @propertyId - see above
 * @content = { value: <object> , label: "<value>" }
 */
updateCustPropSumPanelValue(propertyId, content)

/*
 * Returns a standard control that can then be used in a customPanel.
 * @propertyId - See above
 * @paramDef - Follows the format of https://github.com/elyra-ai/pipeline-schemas/blob/master/common-canvas/parameter-defs/parameter-defs-v1-schema.json).  titleDefinition, current_parameters, conditions, dataset_metadata are ignored and are optional.
 * @parameter - This is the parameter from the paramDef to create the control for.
 */
createControl(propertyId, paramDef, parameter)

/*
 * Returns the translated text for a control given a resource key.
 * Users should be able to use the values from resources that has been uploaded as part of paramDef.
 * @key - Resource key
 * @value - Default value returned when no resource or key has been found.
 */
getResource(key, value)

maxLength for single-line and multi-line control methods

/*
 * Returns the maximum characters allowed for multi-line string controls
 * Default value is 1024
 */
getMaxLengthForMultiLineControls()

/*
 * Returns the maximum characters allowed for single-line string controls
 * Default value is 128
 */
getMaxLengthForSingleLineControls()

Enabling/disabling addRemoveRows methods

/*
 * Set the addRemoveRows attribute to 'enabled' for the given propertyId
 * @param propertyId The unique property identifier
 * @param enabled boolean value to enable or disable addRemoveRows
 */
setAddRemoveRows(propertyId, enabled)

/*
 * Returns the true if addRemoveRows is enabled for the given propertyID
 * @param propertyId The unique property identifier
 * @return boolean
 */
getAddRemoveRows(propertyId)

Enabling/disabling properties editor “save” button methods

/*
 * Set the main "save" button to disabled(true) or enabled(false)
 * @param saveDisable (boolean)
 */
setSaveButtonDisable(saveDisable)

/*
 * Returns the true if the main "save" button is disabled, false otherwise
 * @return boolean
 */
getSaveButtonDisable()

Add static rows for table controls which will disable the re-ordering of the rows that are set as static for the given propertyId

/*
 * Set static rows for the given propertyId
 * @param propertyId The unique property identifier
 * @param staticRowsArr Array of first n row indexes or last n row indexes
 */
updateStaticRows(propertyId, staticRowsArr)

/*
 * Returns the static rows set for the given propertyId
 * @param propertyId The unique property identifier
 */
getStaticRows(propertyId)

/*
 * Removes the static rows set for the given propertyId
 * @param propertyId The unique property identifier
 */
clearStaticRows(propertyId)

Enabling/disabling custom table buttons

/*
 * Set the table button to 'enabled' for the given propertyId
 * @param propertyId The unique property identifier
 * @param buttonId The unique button identifier
 * @param enabled boolean value to enable or disable the button
 */
setTableButtonEnabled(propertyId, buttonId, enabled)

/*
 * Returns the table button states for the given propertyID
 * @param propertyId The unique property identifier
 * @return object An object of buttonIds mapped to their enabled state
 */
getTableButtons(propertyId)

/*
 * Returns the true if the table button is enabled for the given propertyID and buttonId
 * @param propertyId The unique property identifier
 * @param buttonId The unique button identifier
 * @return boolean
 */
getTableButtonEnabled(propertyId, buttonId)

Column visibility methods

/*
 * Check if given column is visible in the table
 * @param propertyId The unique property identifier
 * @param columnIndex Column index in the table
 */
getColumnVisibility(propertyId, columnIndex)

/*
 * Set column visibility
 * @param propertyId The unique property identifier
 * @param columnIndex Column index in the table
 * @param value Boolean value to set column visible/invisible
 */
toggleColumnVisibility(propertyId, columnIndex, value)

Enabling/disabling wide flyout “OK” button methods

/*
 * Set the "OK" button in Wide Flyout to disabled(true) or enabled(false) for given summary panel
 * @param panelId {name: panel.id}
 * @param wideFlyoutPrimaryButtonDisable boolean
 */
setWideFlyoutPrimaryButtonDisabled(panelId, wideFlyoutPrimaryButtonDisable)

/*
 * @param panelId {name: panel.id}
 */
getWideFlyoutPrimaryButtonDisabled(panelId)