Add a new visual part named CustomerView to your
application. In the Composition Editor, add a push button and the
labels and text fields for firstName and
lastName. Drop a Variable part on the free-form surface and
change its type to Customer. Next, change the labels of the
parts so the Composition Editor shows the following:
To enable dropping of customer names on the push button, change the settings for the dragDropSpec property of the push button as follows:
Go to the Script Editor and add a private instance script named transfer:dropData: to CustomerView:
transfer: aCwTransferProcCallbackData dropData: aCwDropTransfer aCwTransferProcCallbackData value notNil ifTrue: [ (self subpartNamed: 'Customer variable') value: (Customer new lastName: aCwTransferProcCallbackData value)]
To enable a dropped name to display in the Last name text field, make the following connections: