Hello Rangsons,
there are so many different application cases, that it makes me difficult to give you a concrete solution for your application. So I can try to only outline the concepts. For more details I recommend you our documentation.
Regardless of your application case, in both dialogs you will need to implement some kind of data interfaces. Through these interfaces you exchange data with the components, e.g. you can query which value is actually stored in the text field Test Name and you can assign new content to display in this text field. Following is the approach how to implement such interface for one value (e.g. Test Name):
Step A.1: In the Application::Component add a new property.
Step A.2: Name the property according to whatever value it should represent. For example, if the property is intended to represent the value corresponding to the Test Name text field, you could name it TestName.
Step A.3: Configure the type property to correspond to whatever the property should be intended to store. For example, if Test Name is a string, then the corresponding property should be configured with data type string.
Step A.4: Edit the OnSet method associated to the property (found as brick just below the property). This method is invoked when new content is assigned to the property and its job is to update the component with the new value. For example, in case of the TestName property, you could relay the assigned value directly to the Test Name text view:
// Relay the just assigned value to the TestNameText view.
TestNameText.String = value;
Step 5: Edit the OnGet method associated to the property (found as brick just below the above described OnSet method). This method is invoked when the content of the property is evaluated (queried) within an expression. For example, in case of the TestName property, you could return the value stored actually in the Test Name text view:
return TestNameText.String;
With the step 1-5 you enhanced the component by an interface composed of one property. Through this interface you can communicate with the component. You can assign a value to display in the component and you can query which value is actually displayed in the component. Since you have more than one value to exchange, repeat the steps 1-5 for all other values (e.g. Prod Name, Prod Type, ...).
Step A.6: Shortly before you present a component as dialog, assign the right values to the corresponding properties. This will have the effect of the assigned values to appear in the dialog. For example:
// Create a new instance of the component.
var Application::Component dialog = new Application::Component;
// Initialize its properties
dialog.TestName = "Some Test Name";
dialog.ProdName = "Some Prod Name";
...
// Present the dialog
PresentDialog( dialog, ... );
Step A.7: When you want the value from one dialog to be passed to other dialog, then you have to clarify the question how does the navigation between the dialogs work. Generally you will access the values found in the first dialog and pass them to the second dialog by using the above described interfaces. For example, if the first dialog implements a button to dismiss the actual dialog and present a second dialog, you could implement following code in the method triggered by the button:
// Create a new instance of the component to present as dialog.
var Application::Component1 dialog = new Application::Component1;
// Initialize the properties of the new dialog with values found in 'this'
// dialog.
dialog.TestName = TestName;
dialog.ProdName = ProdName;
...
// Switch to the new dialog
Owner.SwitchToDialog( dialog, ... );
Often the code intended to present or switch the dialogs is found 'outside' of the actual dialog. In such case you will need to search for the actual dialog to access the values stored in it. You use the method FindCurrentDialog() in such case (see also Enumerate and search for existing Dialogs). For example:
// First search the entire UI for the current dialog. Note the type cast (Application::Component)
// to verify whether the dialog is of the expected class.
var Application::Component current = (Application::Component)GetRoot().FindCurrentDialog();
// There is no such dialog existing
if ( !current )
return;
// Create a new instance of the component to present as new dialog.
var Application::Component dialog = new Application::Component1;
// Initialize the properties of the new dialog with values found in current dialog.
dialog.TestName = current.TestName;
dialog.ProdName = current.ProdName;
...
// Present a new dialog
GetRoot().PresentDialog( dialog, ... );
This is the common approach how to exchange data between components (also explained in the chapter Implementing component interface). Embedded Wizard provides however other techniques to achieve this. As mentioned by Manfred, instead of reading data from dialog A and writing the data to dialog B, you could follow the Mode-View-Controlled approach. In this model you store the data (e.g. TestName, ProdName, ...) as properties in a global objects. When a value is changed in Component A, your implementation updates the corresponding properties in the global object. When a new dialog is presented depending on the values, the dialog accesses the values from the global object.
To implement such approach:
Step B.1: Create first a new empty class. See also Creating non visual components.
Step B.2: Add to the class as many properties as values you want to store. Name and configure the data type of the properties. (similar to the steps A.1-A.3).
Step B.3: Create a global instance of the class as so called auto object. See also Create new autoobject.
Step B.4: Now your implementation of the dialogs can access the values found in the auto object. It can update the values:
// Store actual value found in a Test Name text field in a property of the autoobject
Application::DataObject.TestName = TestNameText.String;
... or read the values:
// Use the value found in the autoobject to initialize a text field
TestNameText.String = Application::DataObject.TestName;
In this manner you use the global object as data container to store and exchange data between several components.
I hope this outline helps you to find the right approach for your application case.
Best regards
Paul Banach