//! ################################################################ //! Copyright (c) 2004 Amazon.com, Inc., and its Affiliates. //! All rights reserved. //! Not to be reused without permission //! $Change: 1486694 $ //! $Revision: #2 $ //! $DateTime: 2007/08/07 01:07:57 $ //! ################################################################ function n2PopoverPaneInitLibrary() { // Begin library code wrapper. Goes all the way to the bottom of the file if (window.goN2LibMon) goN2LibMon.beginLoad('popoverPane', 'n2CoreLibs'); window.N2PopoverPane=function(oPopover, sID) { this.sID = sID; this.aSubPanes=null; this.bIsSubPane=false; this.maxSubPaneWidth; this.currentWidth; this.currentHeight; this.bUseHistory = false; this.bAllowDynamicUpdate = false; this.sDefaultContent = '{PANE_ID}'; this.oPopover=oPopover; this.nDefaultWidth ='auto'; // overrides everything else (inc. min/max) this.nMinWidth = 0; //61; // overrides value obtained from sizing content this.nMaxWidth = 0; //600; // overrides value obtained from sizing content this.nDefaultHeight ='auto'; // overrides everything else (inc. min/max) this.nMinHeight = 0; //60; // overrides value obtained from sizing content this.nMaxHeight = 0; //300; // overrides value obtained from sizing content this.sElementID; // set to change the default elementID to populate/update this.bDisableScrollbars = false; // if true would not allow scrollbars to be added automatically this.bDisableResizing = false; // if true would not compute new pane/popover sizes automatically this.bTemplateHasPlaceholders = false; this.bReplaceTemplateTDFieldPlaceholders = false; this.myStyle; this.LADTimer = null; this.bbLADSupported = false; this.nLADRetries; // calculated in show() this.sLADKey = null; // gaTD[key] exists this.sLADField = null; // gaTD[].field or gaTD[key].field exists this.sLADDUAction = null; var imagePath = goN2Locale.getImageURL('JSF-loading-bar', 'nav2/images/loading-bar.gif'); this.sLADLoadingMessage = '
' + goN2Locale.getString('loading_13548', 'Loading...') + '
'; this.sLADTimeoutMessage = goN2Locale.getString('unable_to_get_info_36020', "Unable to obtain necessary information. Please try again later"); this.bPersistContent = false; } new N2PopoverPane(); N2PopoverPane.prototype.locate=null; N2PopoverPane.prototype.relocate=null; N2PopoverPane.prototype.postPopulate=null; N2PopoverPane.prototype.getID = function() { return this.sID;} N2PopoverPane.prototype.setDefaultWidth = function(n) { this.nDefaultWidth = n; } N2PopoverPane.prototype.setMinWidth = function(n) { this.nMinWidth = n; } N2PopoverPane.prototype.setMaxWidth = function(n) { this.nMaxWidth = n; } N2PopoverPane.prototype.setCurrentWidth = function(n) {this.currentWidth = n; } N2PopoverPane.prototype.setDefaultHeight = function(n) { this.nDefaultHeight = n; } N2PopoverPane.prototype.setMinHeight = function(n) { this.nMinHeight = n; } N2PopoverPane.prototype.setMaxHeight = function(n) { this.nMaxHeight = n; } N2PopoverPane.prototype.setCurrentHeight = function(n) {this.currentHeight = n; } N2PopoverPane.prototype.disableScrollbars = function(f) { this.bDisableScrollbars = f; } N2PopoverPane.prototype.setElementID = function(sID) { this.sElementID = sID; } N2PopoverPane.prototype.getElementID = function() { return this.sElementID; } N2PopoverPane.prototype.persistContent = function (b) { this.bPersistContent = b; } N2PopoverPane.prototype.setStyle= function(n) { this.myStyle = n; } N2PopoverPane.prototype.setUseHistory = function(f) { this.bUseHistory = f; } N2PopoverPane.prototype.useHistory = function(f) { return this.bUseHistory; } N2PopoverPane.prototype.setTemplate = function(s) { this.sTemplate = s; this.sDefaultContent = s; // 9/19/2004, essential currently for the templating(?) code to work? if (this.sTemplate.indexOf('{') >=0) this.bTemplateHasPlaceholders = true; } N2PopoverPane.prototype.replaceTemplateTDFieldPlaceholders = function (b) { this.bReplaceTemplateTDFieldPlaceholders = b; } N2PopoverPane.prototype.setDefaultContent = function (s) { this.sDefaultContent = s; } N2PopoverPane.prototype.isSubPane = function() { return this.bIsSubPane; } N2PopoverPane.prototype.hasSubPanes = function() { return this.aSubPanes != null; } N2PopoverPane.prototype.configureLADSupport = function(b, sKey, sField, sDUAction, sDUParams, sLoadingMsg, sTimeoutMsg) { this.bLADSupported = b; if (sKey) this.sLADKey = sKey; if (sField) this.sLADField = sField; if (sDUAction) this.sLADDUAction = sDUAction; if (sDUParams) this.sDUParams = sDUParams; if (sLoadingMsg) this.sLADLoadingMessage = sLoadingMsg; if (sTimeoutMsg) this.sLADTimeoutMessage = sTimeoutMsg; } N2PopoverPane.prototype._initialize = function(bFirstPopulate) { ; this.resetLAD(); if (bFirstPopulate && this.bPersistContent) this.sDefaultContent = null; var aSubPanes = this.aSubPanes; if (aSubPanes != null) { var nSubs = aSubPanes.length; for (var i=0; i"; } } else { sHtml = xEntry } sHtml += '
Use setLayout(...) to modify what/how entries are displayed.'; return sHtml; } N2PopoverPane.prototype.preparePopulateSubpanes = function(oHotspot) { var aSubPanes = this.aSubPanes; if (aSubPanes != null) { ; var nSubs = aSubPanes.length; for (var i=0; i=0) { sNewContent = this.replacePlaceholders (sNewContent, sAction, sID, sType, sParams, sLinkID, sHref, sLinkText); } if (sNewContent) { this.setContent(sNewContent, null, null, false); } if (this.bAllowDynamicUpdate) this.populateUsingDynamicUpdate(sAction, sID, sType, sParams); this.populateSubPanes(sAction, sID, sType, sParams, sLinkID, sHref, sLinkText); ; if (this.postPopulate) this.postPopulate (sAction, sID, sType, sParams, sLinkID, sHref, sLinkText); if (this.bLADLoading) this.oPopover.sizeOrPositionChanged(); if (this.sHookFormName) { n2HookForm (this.sHookFormName, this, this.oPopover.objectName, this.sHookAction, this.sHookID, this.sHookType, this.hookParams, this.sID); } return true; } N2PopoverPane.prototype.populate = N2PopoverPane.prototype._defaultPopulate; N2PopoverPane.prototype._getElementContents = function(sID) { ; ; var eElem = goN2U.getRawObject(sID); if (eElem) return eElem.innerHTML; else { ; return null; } } N2PopoverPane.prototype._getArrayEntryContents = function(sKey) { ; ; var retval = null if (goN2U.isUndefOrNull(this.oPopover.aDataArray)) { ; } else if (goN2U.isNull(this.oPopover.aDataArray[sKey])) { ; } else { retval = this.oPopover.aDataArray[sKey]; } ;//goN2Debug.debug("N2PopoverPane._getArrayEntryContents ["+sKey+"]+ returned: "+ (retval ? retval : 'null')); return retval; } N2PopoverPane.prototype.populateUsingDynamicUpdate = function(sAction, sID, sType, sParams) { ; sAction = this.sDUAction ? this.sDUAction : sAction; if (!sAction) { ; return; } sParams = sParams ? sParams : this.sDUParams; ; this.requestUpdate(sAction, sID, sType, sParams); } N2PopoverPane.prototype.isDataAvailable = function(sAction, sID, sType, sParams, sLinkID, sHref, sLinkText, fLADMethod) { ; ; if (this.oPopover._isDataAvailable (sAction, sID, sType, sParams, sLinkID, this.sLADKey, this.sLADField)) { this.LADTimer = null; return true; } else { if (--this.nLADRetries && this.oPopover.isVisible()) { if (!this.bLADLoading) { this.setContent(this.sLADLoadingMessage); this.bLADLoading = true; if (this.sLADDUAction) { ; this.sCurrentRequestID = this.oPopover.requestAnonomousUpdate(this.sRequestMode, this.sDUHandlerName, this.sLADDUAction, sID, sType, this.sDUParams); } } var sObjectMethod = this.oPopover.getObjectName() + ".findPane('" + this.sID +"').populate"; if (sLinkText) { var re = /([^\\])'/gi; sLinkText=sLinkText.replace(re, "$1\\'") ; } if (fLADMethod) { this.LADTimer = setTimeout (fLADMethod, this.oPopover.nLADRetryMs); } else { this.LADTimer = setTimeout (new Function("", sObjectMethod + "(" + (sAction ? "'" + sAction + "'" : null) + "," + (sID ? "'" + sID + "'" : null) + "," + (sType ? "'" + sType + "'" : null) + "," + (sParams ? "'" + sParams + "'" : null) + "," + (sLinkID ? "'" + sLinkID + "'" : null) + "," + (sHref ? "'" + sHref + "'" : null) + "," + (sLinkText ? "'" + sLinkText + "'" : null) + ");"), this.oPopover.nLADRetryMs); } ;//goN2Debug.info ("LAD Pane ("+this.sID+") retry ("+this.nLADRetries+")"); } else { this.LADTimer = null; ; this.setContent(this.sLADTimeoutMessage); this.resetLAD(); } return false; } } N2PopoverPane.prototype.setOwner = function(oO) { this.oOwner = oO; } if (window.goN2LibMon) goN2LibMon.endLoad('popoverPane'); } // END library code wrapper function n2PopoverPaneHasStaticPopover() { n2RunIfLoaded("dynUpdate", n2PopoverPaneInitLibrary, "popoverpaneLoad"); } n2RunIfLoaded("staticpopover", n2PopoverPaneHasStaticPopover, "popoverpaneHasStatic");