13.07.2015 Views

Using Caché Studio - InterSystems Documentation

Using Caché Studio - InterSystems Documentation

Using Caché Studio - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Creating a Web User Interface using Zen5. If you are curious about clicking the buttons “New” and “Save,” try it. An error message displays.Click OK to dismiss it.To understand why you saw an error message when you clicked the buttons, look carefully at thevalues of the onclick attribute for each element in XData Contents. Each onclick valueis a JavaScript expression that executes automatically whenever the button is clicked.In these examples, the onclick expression invokes a method that runs in JavaScript on the client.The special variable zenPage indicates that the method is defined in the current Zen page class.The methods themselves are called newRecord and saveRecord.In order to make these onclick values work, you must create client-side JavaScript methods in theZen page class. This is quite simple to do using the Zen Method Wizard in <strong>Studio</strong>.2.4.4 Adding Client-side MethodsIn this step you will add methods that create new objects and save them in response to button clicks.These methods will permit you to use your Zen form to populate your database with objects of thePhoneBook.Person class:1. In <strong>Studio</strong>, open the Zen page class.2. Position the cursor below the closing curly bracket of the XData Contents block, but before theclosing curly bracket for the Zen page class.3. Choose Tools > Templates > Templates or press Ctrl-T to display the <strong>Studio</strong> Template dialog.Choose Zen Method Wizard. Click OK. The following dialog displays:<strong>Using</strong> <strong>Caché</strong> <strong>Studio</strong> 23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!