Expression editor contains Expression Designer component. Expression editor is suitable for scenarios where a user knows a certain formula or expression and does not want to calculate the value. Value is calculated later and with different parameters. The implementation of such feature saves precious time for the end user. It is a unique functionality appropriate for even the most demanding users and their demands.
The appearance and the behaviour of the Expression editor can be defined with its properties:
Property | Description |
---|---|
FormatString | Defines the format in which the text will be displayed. |
NullText | Defines the string that is displayed if the value of a field is missing or null. |
AllowNullInput | If property is set to True, null value can be entered in the editor. If property is set to True, option Clear exists in the editor which inserts null value. |
Example (MxSpace)
To see the implementation of a Expression editor in MxSpace application click Production -> Manage. Try to add new BOM. When editing Formula field, expression editor appears offering to create any kind of expression using pre-prepared variables and functions.
To implement an Expression editor on a field
- Open appropriate adapter (WorkOrderAdapter) in Solution Explorer.
- Expand the desired field (Formula) in the appropriate data source schema (WoBom).
- Click Editor node and select ExpressionEditor from a list of editors in the Available Editors section on the right.
- Right click Schema node in the same data source and select Add Field (Efficiency).
- Expand newly created field and select Value Expression.
- In the section Expression Text enter Eval([DataSources.DataSourceName.FieldName]). *
* In MxSpace example enter Eval([DataSources.WoBom.Formula]).
When editing work order BOM an expression, such as [DataSources.WoBom.Quantity] / 10 can be written in the Formula field. After end edit the formula is calculated and the value is presented in field Efficiency.
MxAdapter
Editors