MX-Frame Library Send comments on this topic.
Expression
See Also
MX-Developer > Data Access Layer - MxAdapter > Designing Data Source > Schema > Designing a Field > Editors > Expression

Glossary Item Box

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

  1. Open appropriate adapter (WorkOrderAdapter) in Solution Explorer.
  2. Expand the desired field (Formula) in the appropriate data source schema (WoBom).
  3. Click Editor node and select ExpressionEditor from a list of editors in the Available Editors section on the right.
  4. Right click Schema node in the same data source and select Add Field (Efficiency). 
  5. Expand newly created field and select Value Expression.
  6. 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.

See Also

MxAdapter
Editors

©2009 Metronik. All Rights Reserved.