Open topic with navigation

TIBCO Business Studio™ - BPM Edition 5.4.0

# Runtime Life Cycle of Custom Control Used within Grid Pane

Using a custom control within a grid pane uses a specialized life cycle. It depends on the supported Render Modes of the Control Type and the Always Render setting on the Control.

If a grid pane is not in the Always Render mode, only one instance of the ControlWrapper gets created for a column. Each cell in that column shares that single instance. When the runtime invokes methods, such as `refresh()` and `getFormattedValue()` on the wrapper, the `getControl()` method on the component interface returns the specific instance for that cell. This way, the ControlWrapper implementation gets specific configuration details of that cell.

## Preparation

The forms runtime repeatedly calls the ControlWrapper's isReady() method until it returns `true`.

## Initialization

When you configure the control in the Always Render mode, the form creates an instance of the ControlWrapper for each cell in the grid table. Users can view the rendering that happens at this point.

When you do not configure the control in the Always Render mode (default), the form creates a single ControlWrapper instance that is shared between the cells in a grid table column. Users cannot view the rendering that happens at this point. The form does not attach the parent node to the DOM at this point but invokes the `ControlWrapper.getFormattedValue(`) method for each visible cell in the column of the grid table.

## Refresh

When you configure the control in the Always Render mode, the form calls the refresh() method as soon as the value or other configuration settings are changed.

When you do not configure the control in the Always Render mode and focus on a cell to edit the value, the form calls the `ControlWrapper.`refresh() method to allow the ControlWrapper to update the rendering and reflect the current value being edited. If you change any of the configuration settings after the last refresh(), the wrapper is notified through the `updates` argument.

## Sorting

If a control manages a complex value, the static compare() method on the ControlWrapper class is called each time user sorts the grid on that column.

## Destruction

When you configure the control in Always Render mode, the form invokes the destroy() method on all instances of the ControlWrapper when the form is being taken out of service or on the specific instance when that row is deleted from the table.

If you do not configure the control in the Always Render mode, the form invokes the destroy() method on the shared instance of the ControlWrapper only when the form is being taken out of service.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Business Studio™ - BPM Edition

Copyright © 2015-2023. Cloud Software Group, Inc. All Rights Reserved.