How Do I Dynamically Replace the Content of a Subform? (Magic xpa 4.x)
Usually each subform will display one program or task. However, you can also dynamically change the content of a subform for specific purposes. For instance, in this example, the user chooses from a menu to display Customers or Orders, and a different program is called depending on their choice.
-
In Subform properties, give the subform a Control Name.
-
Create a Call operation to call the program or subtask you want to display.
-
Set the Destination property to the Control Name of the subform. In this example, the subform called Left is used to display either the Orders or Customers.
Now, you can run the program and see that the required tasks run in the appropriate area.
Note: Subforms are often used in conjunction with Tab Folder controls for this kind of effect as well. In that case, just attach the subform to the appropriate tab; no Call operation is needed. You can also use this technique with frames rather than subforms.
The Online and Rich Client Samples projects (program SB11 and RSB11)