[[TOC(heading=Training Section Contents, Training*)]] = Section 6: Flow and Dependencies = It would be nice if all application functionality were simple and we didn't have to contend with real world business requirements. In this next walk-through we are going to use Model-Glue to enforce some application logic dependencies. Take special care to notice the auto-documentation features of Model-Glue when used in this way. In this next exercise, we'll be creating a form to create/update Shipment Items, and also a way to remove Shipment Items. As such, we'll need several Event Handlers, a few controllers and a new view file. 1. Open /PlantOMatic/config/ModelGlue.xml, find and insert the following XML: {{{ }}} 2. Open /PlantOMatic/config/ModelGlue.xml, find and insert the following: {{{ }}} 3. Open /PlantOMatic/config/ColdSpring.xml and insert the following bean definitions for our pre-made manager objects: {{{ }}} 4. Create a file named !ItemController.cfc in the /PlantOMatic/controller directory then paste the following code in the body: {{{ }}} 5. Create a file named !PlantController.cfc in the /PlantOMatic/controller directory and paste the following code in the body: {{{ }}} 6. Open /PlantOMatic/views/ Form.Item.cfm and prepend the following: {{{ }}} == Putting It All Together == We've finished working with the Model-Glue XML, !ColdSpring XML, two new Controllers, and the HTML form for Item. Let's test our changes. 1. At the Saved Shipment screen, click the Display link for one of the Shipments 2. Press the New Item button; Your screen will look like the figure below:[[BR]] [[Image(training06-1.png, nolink)]] 3. Next, using the form, add an item, then press the Save button 4. Your item will be saved and you will be taken to the Display Shipment screen:[[BR]] [[Image(training06-2.png, nolink)]] ---- Back: [wiki:Training/Section05 Training Section 5: Mother's Little Helper] Next: [wiki:Training/Section07 Training Section 7: Crossing the Generational Gap]