MX-Frame Library Send comments on this topic.
State Management
See Also
MX-Developer > User Interface - MxPart > State Management

Glossary Item Box

Often is the case when an action is depended on some previous exactly defined events. These events then trigger an action. In order to achieve this on user interface level, state management feature is introduced. The feature is implemented with the help of State Management Designer.

State Management Designer

In State Management designer it is possible to define items which are hooked on an event of any data source in any adapter used on the user interface. For each such item it is possible to define a control and its property which will be changed. It is also possible to define the value which is assigned to the property. This is done by defining properties for individual items.

Several commands are available for manipulation with state management items.

Command Description
Property State Adds new item to the end of the Existing Items list. Items can be configured by setting its properties in Item Editor section.
Remove Removes selected item form the Existing Items list.
Clear Removes all items from Existing Items list.

Each item has several properties which define its data, design and target.

Property Description
Adapter Defines the adapter which provides events to hook on to. It is possible to select any adapter attached to the MxPart.
DataSourceName Defines the data source which will provide events. Selected data source can be any data source created in adapter selected in property Adapter.
EventName Defines the event which will be listened. When the event occurs, value defined in property Value will be assigned to the property defined with property TargetProperty.
Value Defines the value which is assigned to the property defined in TargetProperty property. Value is defined in Expression Designer.
Target Defines the control, on the user interface, whose property will be changed when the event occurs.
TargetProperty Defines the property which will be changed when the event occurs.

Using these properties it is possible to implement user interfaces with even the most complex customization logic imaginable.

Example (MxSpace)

To see the implementation of state management feature in MxSpace application click Production -> Stock. In the user interface a chart and a report are presented in sections Stock Report and Stock Chart. Change a data of a row by adding some quantity with the help of Add button. See that report and chart section titles change upon update. If you refresh data, titles are changed again to the text displayed at the beginning.

To implement state management

  1. Open MxPart component (StockPart) by double clicking it in Solution Explorer.
  2. Right click StateManagement, at the bottom of the screen, and select Run Designer.
  3. Click PropertyState button on the ribbon and select newly created item in Existing Items section.
  4. In property Adapter select appropriate adapter component (stockAdapter1)
  5. In property DataSourceName select appropriate data source (Stock).
  6. In property Event select the event (DataUpdated) you wish to listen.
  7. In property Value define the value (‘Stock Chart – Data Obsolete’) for the TargetProperty.
  8. In property Target select the control (layoutControlGroup8) which property you wish to change.
  9. In property TargetProperty select the property (Text) you wish to change or set.

Repeat these steps in order to create as many items as you wish and hook to as many events you as need.

See Also

©2009 Metronik. All Rights Reserved.