Expression

Description

The ExpressionElementWdg allows you to use the TACTIC expression language to determine the value displayed in the table cell. The expression is caclulated from a starting sobject which represents the sobject in the particular row in the table. The expression is evaluated for each sobject on every row. When an expression is evaluated, the value is added to a dynamic attribute of the sobject and can be used in future expressions in this widget. Please refer to the expression language reference for more information on the expression language.

Info

Name

ExpressionElementWdg

Class

tactic.ui.table.ExpressionElementWdg

Category

Common Columns

Supported Interfaces

TableLayoutWdg

TACTIC Version Support

2.5.0 +

Required database columns

depends on expression
Implementation

Display the total cost of an item by multiplying the total_number column with the unit_cost column When an expression is evaluated by the ExpressionElementWdg, a new attribute with the name of the element is dynamically added to the sobject (in this cost) which can be used in the "bottom" directive.

Options

expression

Expression to evaluate the widget

alt_expression

Alternate expression to evaluate the widget for alternate use, like edit value

inline_styles

Styles to add to the DIV generated that contains the result of the expression

return

single|list - Determines what the expression return type should be
bottom Expression to calculate the bottom row of the table
mode value|boolean|check - Display mode for this widget
enable_eval_listener Currently javascript expression evaluation is not fully baked, so only use the client side evaluation listener when needed and NOT by default
icon_expr Expression to evaluate which icon to use when mode = 'icon'
Examples

Display the number of tasks for a given sobject and then display the total number at the bottom.

Mode "boolean" displays a green dot for every sobject that has an expression that evalutes to True. In this case, a green dot is display on every row where the number of tasks is greater than zero.

Another example of a mode which displays a checkbox instead of red/green dots. The checkbox appears for any result greater than zero

The expression language has the ability to get values from other related tables. The following example illustrates an expression to find the description of the parent sequence of a shot.

Ultimately, the ExpressionElementWdg can make use of any expression in the TACTIC Expression Lanaguage.

When using mode = 'icon', it is possible to set up an expression using icon_expr to determine what that icon should be. A special variable $VALUE is used to determine the value of the expressions