12.07.2015 Views

Using Zen Components - InterSystems Documentation

Using Zen Components - InterSystems Documentation

Using Zen Components - InterSystems Documentation

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

4<strong>Zen</strong> FormsForms permit the user to enter data. A <strong>Zen</strong> control is a component that displays application data and allows the user to editthis data. A <strong>Zen</strong> form is a specialized group component designed to contain control components. <strong>Zen</strong> forms have the samestyle and layout attributes as any <strong>Zen</strong> group. Also, because they are groups, forms may contain any other type of <strong>Zen</strong>component.Like all <strong>Zen</strong> components, a <strong>Zen</strong> form must be the child of a <strong>Zen</strong> page object. This means that if you want to provide a formfor a <strong>Zen</strong> application, you must create a <strong>Zen</strong> page class that includes a form component inside the container. Twocomponents are available:• — A <strong>Zen</strong> group that contains a specific list of control components. These controls may or may not take theirvalues from a data controller, but their layout is entirely determined by the definition in XData Contents.• — An extension of that dynamically injects control components into a group (or groups) on the<strong>Zen</strong> page. The list of controls may be determined by the properties of an associated data controller, or by a callbackmethod that generates a list of controls. Layout is automatic, determined by code internal to the .There is a Studio tutorial that uses <strong>Zen</strong> wizards to create a form-based user interface for a simple application. See thechapter “Building a Simple Application with Studio” in the book <strong>Using</strong> Caché Studio.For information about data controllers, see the chapter “Model View Controller.”4.1 Forms and ControlsThe <strong>Zen</strong> library includes a number of controls for use in forms. Many of these controls are wrappers for the standard HTMLcontrols, while others offer additional functionality. The following figure displays a form that contains a number of controls,including text fields and radio buttons. This is the sample form generated by the class ZENDemo.FormDemo in the SAMPLESnamespace.<strong>Using</strong> <strong>Zen</strong> <strong>Components</strong> 87

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

Saved successfully!

Ooh no, something went wrong!