JAVA Tech VERSION 3.0 manual Testing your Event Handler, MayScript tag

Page 88

Testing your Event Handler

There may be cases where ‘LiveConnect’ is not implemented (older browsers or some browser implementations on non-MS Windows platforms) which will mean JavaScript cannot call applet methods and the event handler functionality will not work. In all other cases the following methods may help in debugging potential event handler problems…

You need to make sure the MayScript and eventHandler tags are specified. If you have made a mistake with either then the following methods will help indicate where the problem lies…

isEventHandlerOK()

getEventHandlerError()

And can be used as follows…

If (!document.ViewONE.isEventHandlerOK())

{

alert(document.ViewONE.getEventHandlerError());

}

If you receive an error message when the applet attempts to call your event handler, then assuming LiveConnect is enabled, the most likely cause is that the incorrect name for your event handler was supply to ViewONE. Note that JavaScript function names are case sensitive.

The MayScript tag

The MayScript tag is required if any applet is to call JavaScript methods. This tag was introduced by Netscape and is also implemented in Internet Explorer. We have however noticed that the use of this tag can reduce start-up performance for Netscape 4 because it appears to force all applets to be recompiled with each invocation. Netscape 7 however does not suffer from this problem.

88

Image 88
Contents ViewONE JavaScript API Manual Contents Specifying an Annotations File Viewing Toolbars and Buttons Timeout/User Idle Control Introduction Applet user interface Installing ViewONE ViewONE StandardMayscript parameter ViewONE ProApple Macintosh users JavaScript Using ViewONE Standard on IE for Apple Macintosh Apple Macintosh users HtmlSetting up Windows 2003 server Page Page ViewONE JavaScript Overview JavaScript Reference General Applet Control Method isReadyMethod getVersion Opening documents and images OpenFilefilename,CloseDocument ViewONE.closeDocument Closes an open documentPage Method Group Method openListlistFile, ReloadList OpenDocindexNextDoc PrevDoc FirstDoc LastDoc GetDocIndex GetNumDocs MethodgetNumPagesMethodsetPagepage Method getPageMethod nextPage Method previousPageMethodgetDocReference Method getCacheFileSpecifying an Annotations File MethodsetAnnotationFilefilenameSaving documents and images SavefilenameSavePagefilename MethodsaveSelectedfilenameMethodisMultipageTif SetHyperlinkurl, dblClick Document hyperlinksClearHyperlink Method Pro-Only Method Pro-Only Method Cold Viewing Options Pro-Only SetBackgroundImagefilename, pageNumber SetBackgroundImageEnabledtrue/false IsBackgroundImageEnabledDocument Indexes Pro-Only SetIndexListFileURLImage InvertSetInvertedtrue/false IsInvertedIsEnhancetrue/false SetEnhanceModemodeGetEnhanceMode SetRotationangleMethod initializeRotationArrayint size Method setRotationArrayint angle, intMethod applyRotationArray Method getRotationMethodrotateClockwise Method rotateCounterclockwiseRotate180 SetFlipmodeGetFlip SetScalescaleGetScale GetStatesViewONE.zoom100 Zooms image to 100% full resolution Method setStatesstring statesMethod zoomOut Method zoom100Method setZoomzoom Method setZoomAndXYScrollzoom, x, yMethod zoomAreax, y, width, height, highlight, seconds SetXYScrollx, yMethod setDraggingEnabledtrue/false Method isDraggingEnabledMethod resetBrightness Method setBrightnesspercentMethod resetContrast Method getBrightnessMethod setContrastpercent Method getContrastMethod resetLuminance Method setLuminancepercentMethod getLuminance Method getImageWidthMethod getYResolution Method getXResolutionGetImageHeight SetViewview ViewingGetView SetAreaZoomtrue/false IsAreaZoomToggleAreaZoom Method setMagnifiertrue/falseMethod setMagnifierInternaltrue/false IsMagnifier ToggleMagnifierSetMagFactor Method getMagFactorSetImageForeColorcolor IsNewWindowVisibleShowImageForeColorDialog SetImageBackColorcolor ShowImageBackColorDialogLabels Selection and clipboard Method selectPageint pageNumberMethod clearSelections Method copyPageToClipboardPrinting PrintPagePrintDocument PrintRangePrintSelected PrintVisiblePrintTransformed SetPrintDialogtrue/falseMethod setPrintCopiesinteger Method isPrintDialogMethod setPrinterstring Method setPrintHeaderheaderString Or some other informational textMethod setPrintAutoRotate true/false Toolbars and Buttons Method setScrollbarstrue/falseIsScrollbars SetStatusBartrue/falseMethod setFileButtonstrue/false Method isFileButtonsIsImageButtons Method setImageButtonstrue/falseSetPrintButtonstrue/false Method isPrintButtons SetInvertButtonstrue/falseIsInvertButtons Method setNewWindowButtonstrue/falseIsNewWindowButtons SetViewButtonstrue/falseMethod isViewButtons Method setAllButtonstrue/falseMethodsetPageButtonstrue/false Method isAllButtonsMethod isPageButtons SetAdjustToolVisibleOnOff ToggleAdjustToolIsAdjustToolVisible Menus and keys SetFileMenustrue/falseIsFileMenus ViewONE.setFileMenustrueIsViewMenus SetViewMenustrue/falseViewONE.setViewMenustrue IsImageMenus SetImageMenustrue/falseViewONE.setImageMenustrue IsPrintMenus SetPrintMenustrue/falseViewONE.setPrintMenustrue IsPageMenus SetPageMenustrue/falseViewONE.setPageMenustrue IsSelectMenus SetSelectMenustrue/falseViewONE.setSelectMenustrue IsPreferenceMenus SetPreferenceMenustrue/falseViewONE.setPreferenceMenustrue SetAllMenustrue/false IsAllMenusSetFileKeystrue/false IsFileKeysSetImageKeystrue/false IsImageKeysIsPrintKeys SetPrintKeystrue/falseSetViewKeystrue/false IsViewKeys SetPageKeystrue/falseIsPageKeys SetSelectKeystrue/falseMethod setAllKeystrue/false Method isSelectKeysMethod isAllKeys Timeout/User Idle Control Method setTimeoutsecondsMethod getTimeout Method stopTimeoutMethod getTimeLeft Event Handler and Event Handling Events handler change in ViewONE Version Events ids and descriptions DocN Html tag is used see Html manual End tabReady First time the page is viewed Event Handler example HSPACE=0 VSPACE=0Testing your Event Handler MayScript tag