Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Insert excerpt
_Banners
_Banners
namescreen
nopaneltrue

This page is for data modellers or application developers who want to apply special formatting to data that meets specific criteria.

Overview

A formatting rule allows you to specify an expression which evaluated can apply the selected style to the parent object. It allows to apply styles conditionally, depending on current values displayed on the screen; see Applying Formatting Rules for some examples.

A formatting rule can be applied to a

stream

view attribute or to a

layout

component. If you apply a formatting rule to

a layout

a template component, all

layout

components created from the template will have a copy of the formatting rule applied.

Basic Settings_standard_settings

 

Insert excerpt
_property_toolbar
_property_toolbar
nopaneltrue

Insert excerpt

_standard_settings

_property_tabs
_property_tabs
namebasic-h
nopaneltrue

Insert excerpt
_parent
_parent
nopaneltrue

Basic Settings

FieldDescription
Rule Expression

Expression to be evaluated on order to determine should the Style be applied. This expression takes PhixFlow Internal Variables

 including _current, _field, _itemNumber and _this

.

See examples below. For more help on expressions, see Regular Expressions and Expressions and PhixScripts.

StyleStyle to be applied when the Rule Expression evaluates to true.
OrderOrder of the Rule Expression.
EnabledFlag showing is the Rule Expression enabled.
Stop If TrueFlag showing if other rules shouldn't be applied if the current Rule applies.

Insert excerpt
_audit
_audit
nopaneltrue

Example

For the Status Type attribute in a

stream

view, set the properties to:

Properties

For the Status Type attribute in a

stream

view, set the properties to:

  • Rule Expression:
    • either    _field.value == "OK"
    • or   _current.StatusSummary=="Validation Passed"
  • StyleBackgroundColour-LightGreen
  • Enabled
    Insert excerpt
    _check_box_
ticked
  • tick
    _check_box_
ticked
  • tick
    nopaneltrue

_field.value == "OK" identifies the status type of OK and highlights the cell

_current.StatusSummary=="Validation Passed" identifies the status summary of Validation Passed and then highlights the corresponding status type cell.

Resulting View

This displays the OK field with a green background.

Image Modified

Formatting Rule Expressions

Variables

In formatting rules, you can use the following Internal Variables.

  • To determine the
_form, _grid and _current
  • maximised state of a screen, use _screen. In a formatting rule, use the state of this variable to set the button icon. This means the button can match the current maximised state of the screen.
  • To act on a specific record
. The record depends on the structure of layout components on the dashboard.
  • use one of the following:
Formatting expression variable
Where
Stream view directly on a dashboardform on a dashboardstream view on a formform on a cardgrid on a card
can the variable be used?

Description

View

Form

Card

Form Fields

_form 

 acts

Acts on the record

na

Provides access the the data currently displayed on the form

currently displayed on the formcurrently displayed on the card
backing the card_grid  acts on the recordnanana_current  acts on the recordcurrently displayed in the grid
na

.

e.g. _form.MyAttribute

n/a

Yes

Yes

Yes

_grid 

Acts on the record(s)

References the record currently selected on a grid.

e.g. _grid.MyColumn

Yes, can be used in actions to get details of the selected record.Yes, can be used to reference a selected grid item.Yes, can be used to reference a selected grid item.Yes, can be used to reference a selected grid item.

_current 

Acts on the record(s)


use _current in expressions for the CSS Properties of grid rows or cards.

e.g. _current.AnyColumn

currently displayed in the grid

n/acurrently displayed in the cardn/a

_selected 

currently displayed in the grid

Acts on the record

The currently selected item, i.e. The selected record or card.

e.g. _selected.AnyField

n/aCurrently selected field

Currently selected card or field on the card.

n/a

_field.Value

The value held in the form field.

The value held in the form field.

e.g. if _field.value > 100

n/aAccess the value in the fieldAccess the value in the fieldn/a

Functions

For quick changes to screen appearance, you want formatting rules to be evaluated quickly. To ensure a quick response, only use the attribute functions that are evaluated by the client rather than the server; see the list of Responsive Attribute Functions.

Live Search
spaceKey@self
additionalnone
placeholderSearch all help pages
typepage

Panel
borderColor#00374F
titleColorwhite
titleBGColor#00374F
borderStylesolid
titleSections on this page

Table of Contents
maxLevel3
indent12px
stylenone


Learn More

For links to all pages in this topic, see Designing Screens.