Communicating with Components |
Components are often separated into two categories: those that display data (viewers) and those that provide access to data (models). These different kinds of components break the complex process of displaying data into logical parts. See Models and Viewers for more information about model/view architecture.
SAS/AF software provides an easy way for you to add model components and viewer components to your applications. You can set model/view component communication during application build time (that is, within the Build window) by
For step-by-step information, see "Assigning Models to Viewers" in the SAS/AF online Help.
Determining When to Use Model/View Communication |
Use model/view communication when you want to attach a non-visual component (model) to a visual component (viewer) to display specific data.
The following table lists the default models and viewers that SAS/AF software provides. It also shows which models and viewers can be used together. Within the corresponding sections of the table, any model on the left can be used with any viewer on the right. The appropriate model/view combination depends on your final goal.
Use any of these models... | with any of these viewers... |
---|---|
Catalog Entry List
Variable Values List |
Combo Box |
SAS Data Set
SCL List |
Form Viewer
Table Viewer |
Note: You can create and/or customize models and viewers within a SAS/AF application if the models and viewers that are provided do not meet the needs of your application. For information on creating a new model or viewer, see Implementing Model/View Communication. In addition, if you plan to use a model/view pair regularly, you might want to create a composite. For more information on creating a composite, see "Creating Composite Controls" in the SAS/AF online Help.
Examples |
You can use model/view communication to display a list of color choices in a list box. Additionally, you can set this model/view component communication by dragging and dropping components, or by using the Properties window.
To set model/view communication by dragging and dropping components:
Drag a List Box control from the Components window and drop it onto the frame.
Drag the Color List model from the Components window and drop it onto the List Box.
To set model/view communication with the Properties window:
Drag a List Box control from the Components window and drop it onto the frame.
Drag a Color List model from the Components window and drop it onto the frame.
In the Properties window, open the Attributes table for the List Box control.
The above examples show that some models can return information at build time. The list box that serves as the viewer is automatically populated with values when the model is attached.
The following example shows that other models return information only at run time. In this situation, the model information is not displayed in the viewer during build time.
Place a Combo Box control and a Catalog List model on the frame.
In the Properties window, open the Attributes table for the Combo Box control.
In the Properties window, open the Attributes table for the Catalog List model.
Select Build Test to run the frame and then select the down arrow in the combo box to see a catalog list.
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.