This example shows how to wrapper a view that prompts users to specify a customer name, then use the wrappered view in another view that displays the specified name.
Making the part to be wrappered
Begin by creating an application, adding a visual part to it, and opening a
Composition Editor on the visual part. Then, in the Composition
Editor, make the following user interface:
So other parts can use the data entered into the text field, add scripts that provide a public interface for the text field:
customerName
Next, return to the Composition Editor and add the following connections:
After you make the connections, the Composition Editor shows the
following:
Finally, save the part.
Making the part that uses a view wrapper
Now make the part that uses the part you just made. Begin by adding
a new visual part to your application, and opening a Composition Editor on
it. Then, in the Composition Editor, make the following user
interface:
Next, select
(Models category) and
(View Wrapper part), then click on the free-form surface. Open the
settings for the part and specify the following in the partName
field:
Add customer
Then set the viewPartClass field to the name which you gave the part to be wrappered.
Adding the remaining connections
So the part you've just made can use the wrappered part, add the following connections:
Also add two connections that enable users to delete the contents of the text field in the Customer window:
The Composition Editor now displays the following:
Test and save your work.