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.

Popup WindowsTable 8–1: Client Side Methods for Controlling Popup WindowsClient-Side MethodlaunchPopupWindow(...)firePopupAction(...)onPopupAction(...)cancelPopup()DescriptionLaunch a popup window. Either identify the parent component, or allow it todefault to the current <strong>Zen</strong> page.Notify the parent component for the current popup that a user action hasoccurred. Optionally close the popup as well.The parent component invokes this method each time it is notified that a useraction has occurred on the popup.Close the current popup with no further action.To display a popup window from a <strong>Zen</strong> page, follow these steps:1. Create a <strong>Zen</strong> page class to display as a popup window. In our examples, this will be “the popup page” or:MyApp.MyDialog.clsWhen you design a popup page, add properties to it that correspond to URI parameters you expect to pass to it wheninvoking the popup; for example:Property ABC As %String(ZENURL="ABC");2. Open a <strong>Zen</strong> page class that you plan to use as the window from which you will launch the popup. In our examples,this will be “the parent page.”3. Add a client-side method to the parent page and make this method call launchPopupWindow.In the following example, the popup page class name appears as the first argument in the call to launchPopupWindow,correctly enclosed in zenLink syntax with single quotes. This call to launchPopupWindow passes a single URIparameter called ABC to the popup page with a value of 22:ClientMethod showPopupWindow() [ Language = javascript ]{var parms = new Object();parms.ABC = 22;zenPage.launchPopupWindow(zenLink('MyApp.MyDialog.cls'),'A True Dialogue','status,scrollbars,resizable,width=400,height=300',parms);}For more detailed descriptions, see the table “launchPopupWindow and its Arguments” following these instructions.4. Place a component on the parent page whose onclick attribute invokes the client-side method that invokeslaunchPopupWindow. For example:5. Examine the popup page class. Make sure it provides a component that invokes the firePopupAction method.firePopupAction notifies the parent of the popup window that a user action has occurred in the popup. firePopupActionhas three arguments:• action — If an action parameter is not specified, the literal string ok is the action code.• value — Your code must provide a value; this value is automatically passed as an argument to the parent’sonPopupAction method.• close — close is true by default. If true, the popup window closes after notifying the parent window.<strong>Using</strong> <strong>Zen</strong> <strong>Components</strong> 231

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

Saved successfully!

Ooh no, something went wrong!