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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Control Methodsis preserved when the data is captured. If a control has multiple values, such as a list that presents several items, thenthe captured value is the value of the list item where the cursor was positioned when the user clicked the mouse button.Data drag works only if the control where the drag began has its dragEnabled attribute set to true.• A data drop onto a control occurs when the user releases the mouse button following a drag operation from anothercontrol. Data drop replaces the logical value and displayed value of the control where the drop occurred with the valuesthat were being dragged. If a control has multiple values, such as a list that presents several items, the “drop” operationdrops the value onto the specific list item where the cursor was positioned when the user released the mouse button.Data drop works only if the control where the drop ended has its dropEnabled attribute set to true.For more information about how to configure data drag and drop for <strong>Zen</strong> controls, consult the following sections:• “Drag and Drop”in the “<strong>Zen</strong> Component Concepts” chapter of <strong>Using</strong> <strong>Zen</strong> introduces all types of drag and dropoperations. It explains how to enable and configure data drag and drop features for controls while placing them on a<strong>Zen</strong> page. Briefly, you can enable the features by setting the dragEnabled and dropEnabled attributes to true. Havingdone that, you have the option of configuring the exact ways in which these features work, by setting the onafterdrag,onbeforedrag, ondrag, and ondrop attributes. Special configuration is not necessary, as each control has its own wayof handling drag and drop, but it is available if you prefer it.• “Data Drag and Drop Methods” in the “Custom <strong>Components</strong>” chapter of Developing <strong>Zen</strong> Applications explains howto write a custom control component that has unique drag and drop behavior. This ensures that, if you want specialdrag and drop behavior for a control, the desired behavior is applied consistently each time a developer places thecontrol on a <strong>Zen</strong> page, without requiring the developer to configure the control by setting the onafterdrag, onbeforedrag,ondrag, and ondrop attributes.• “ Drag and Drop” in the “Lists” section of this chapter explains how the control allows the userto reorder entries in a list, or move an entry from one list to another, using drag and drop motions. This is in additionto data drag and drop, which the also supports.• For the most part, data drag and drop applies only to control components, each of which has a logical value and a displayvalue. However, , which is not a control, supports data drag because each of its nodes actually has a logicalvalue and a display value. For details, see “ Drag and Drop” in the chapter “Other <strong>Zen</strong> <strong>Components</strong>.”5.3 Control MethodsEach control has internal methods, which you can study in more detail by viewing the online class documentation for%ZEN.Component.control and its subclasses.The most important of these methods are those used to manipulate the value of the control. You can get and set the valueproperty using the client-side getProperty and setProperty methods. In fact, getProperty and setProperty are availablefor you to work programmatically with any of the properties listed in the “Control Attributes” section, not just value.Calling the setProperty method ensures that all actions relating to setting the property also occur, including rendering thecontent within the control on the page.<strong>Zen</strong> controls also define the convenient client-side methods getValue and setValue, which work only on the value property,and so do not require you to specify which property you wish to change.5.4 Buttons<strong>Zen</strong> offers the following button-style controls:<strong>Using</strong> <strong>Zen</strong> <strong>Components</strong> 105

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

Saved successfully!

Ooh no, something went wrong!