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

Glossary Item Box

It is possible to define read only condition for every field created in a schema. Read only condition defines the behavior of a field based on runtime data. Condition can consist of parameters which are dynamically changing during the execution of the application.

Field is read only if it is visible in edit mode but it cannot be changed. Therefore it is not affected by insert or update statements.

Field is set to read only mode if the condition defined is fulfilled. Condition is defined with Expression Designer. This means that the developer has wide variety of options and possibilities when creating such a condition. It can depend on all kinds of variables. Variables can be manipulated with any of the functions available in Expression Designer.

Read only condition is a must be feature in application with sophisticated business logic. Using it, it is possible to even more customize an application.

Example (MxSpace)

To see the implementation of a read only condition in MxSpace application click Production -> Manage. In the user interface for managing work orders in the grid displaying work order head, fields ID and Name can only be edited if the status of the selected work order is Open.

To implement read only condition

  1. Open appropriate adapter (WorkOrderAdapter) in Solution Explorer.
  2. Expand the desired field(Code and Name) in the appropriate data source schema (WorkOrder).
  3. Select Read Only Condition node.
  4. With Expression Designer build appropriate condition. *

* In MxSpace the following expression is used: [DataSources.WorkOrder.StatusId] > 1 && !IsNull([DataSources.WorkOrder.StatusId])

First part of the condition checks the status of the current work order. The second part of the condition, the part behind the logical AND operator, is needed in case a new work order is inserting. It is necessary because it currently holds Null value.

See Also

©2009 Metronik. All Rights Reserved.