How Do I Unify and Standardize the Project’s Data Fields and Visual Controls? (Magic xpa 4.x)
Within any programming project, you have various types of data issues:
-
The data itself: the length of each field, how it is stored, its data type, and the valid values. In Magic xpa, the field class models encapsulate this information in a field model.
-
How the data looks to the user, and how the user interacts with it.
-
Magic xpa, the GUI Display, GUI Output, Browser and Text-based models encapsulate the look and feel in a control model.
When you put a data field on a form, you can specify all the details of the control, or choose from your set of control models. However, you can also specify the control model as part of the data model, so the two are linked at the most basic level. This will save you a lot of time while programming, and standardize which types of data are represented by which visual control.
Prerequisite: The control model must already exist.
-
Position the cursor on the field model.
-
Go to the field properties for the model (Alt+Enter).
-
Go to the Style you want to change. For instance, if you want to change how fields look when displayed on a Windows screen, go to GUI display.
-
A new properties pane will open up, titled Control Properties. This pane allows you to specify details of the control. If you want, you can specify the details here manually. Usually though, it makes more sense to specify a model for the control properties.
-
From the Model field in Control Properties, zoom (F5 or double click) to select the control model you want to use.
Now, your data model is connected to a control model. Whenever that data model is used to define a piece of data, it will automatically have the visual properties specified in the control model.
How Do I Define Reusable Data Objects?
The Online and Rich Client Samples projects (programs MD01, MD02 and RMD01, RMD02)