AdfRichUIPeer.createPeerClass(AdfDhtmlPanelHeaderPeer,"AdfDhtmlQueryPeer",!1);AdfDhtmlQueryPeer._INNER_SD_PEER=AdfRichUIPeer.createInnerPeerClassWithSubId(AdfDhtmlShowDisclosurePeer,"InnerQueryShowDetailPeer","_afrDscl");InnerQueryShowDetailPeer.InitSubclass=function(){AdfDhtmlTogglePeer.Config(this,{toggledStyleClass:"af|query::disclosed-icon-style",untoggledStyleClass:"af|query::undisclosed-icon-style"})};
InnerQueryShowDetailPeer.prototype.HandleClientSideToggle=function(a){return InnerQueryShowDetailPeer.superclass.HandleClientSideToggle.call(this,a)?this.outerThis.__handleClientSideDisclosure(a):!1};InnerQueryShowDetailPeer.prototype.GetTitle=function(){return this.getComponent().getProperty("headerText")};AdfDhtmlQueryPeer.prototype.Init=function(a){AdfDhtmlQueryPeer.superclass.Init.call(this,a);this._isHeaderless(a)||(this._disclosurePeer=new AdfDhtmlQueryPeer._INNER_SD_PEER(a,this))};
AdfDhtmlQueryPeer.prototype.initialize=function(a){AdfDhtmlQueryPeer.superclass.initialize.call(this,a);this._disclosurePeer&&this._disclosurePeer.initialize(a)};
AdfDhtmlQueryPeer.InitSubclass=function(){AdfRichUIPeer.addComponentEventHandlers(this,AdfDialogEvent.EVENT_TYPE,AdfUIInputEvent.CLICK_EVENT_TYPE,AdfActionEvent.ACTION_EVENT_TYPE,AdfValueChangeEvent.VALUE_CHANGE_TYPE,AdfUIInputEvent.KEY_UP_EVENT_TYPE,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE,AdfUIInputEvent.KEY_PRESS_EVENT_TYPE,AdfDisclosureEvent.EVENT_TYPE,AdfPopupOpeningEvent.POPUP_OPENING_EVENT_TYPE);AdfRichUIPeer.addComponentPropertyChanges(this,"disclosed");this.CONTENT_SUBID="content";this._CONJUNCTION_SUBID=
"conj";this._DISCLOSE_SUBID="_afrDscl";this._OPERATOR_DROPDOWN_SUBID="oper";this._MODE_BUTTON_SUBID="mode";this._RESET_BUTTON_SUBID="reset";this._SAVE_BUTTON_SUBID="save";this._SEARCH_BUTTON_SUBID="search";this._SSEARCH_CHOICE_SUBID="saveSrch";this._CRITERION_VALUE_SUBID="val";this._ADDFIELDS_BUTTON_ID="adFlds";this._ADDFIELDS_MENU_ID="fldsM";this._ADDFIELDS_GROUP_MENU_ID="adFldGrpMenu";this._ADDFIELDS_SUBID="fldItem";this._ADDFIELDS_GROUP_MENU_ADDALL_ITEM_SUBID="adFldGrpAddAllItem";this._PSSPOPUP_SUBID=
"PSSPop";this._PSSDLG_SUBID="PSSD";this._PSSDLG_SSEARCH_CHOICE_SUBID="PSS_Srchs";this._PSSDLG_SSEARCH_NAME_SUBID="PSS_name";this._PSSDLG_UIHINT_AUTOEXECUTE_SUBID="PSS_autoEx";this._PSSDLG_UIHINT_SHOWINLIST_SUBID="PSS_SiL";this._PSSDLG_UIHINT_DEFAULT_SUBID="PSS_def";this._APPLY_BUTTON_SUBID="apply";this._DELETE_BUTTON_SUBID="delete";this._CRITERION_SUBID="crtn";this._DUPLICATE_BUTTON_SUBID="duplicate";this._PSSDLG_ID="dlgPSS";this._SSDLG_ID="dlgSS";this._REORDER_BUTTON_SUBID="reorder";this._REORDER_POPUP_SUBID=
"REPop";this._REORDER_DIALOG_SUBIID="REDlg";this._REORDER_SHOW_DETAIL_SUBID="REShDetail";this._REORDER_PANEL_GROUP_SUBID="REPanGrp";this._REORDER_TREE_SUBID="RETree";this._REORDER_BUTTON_MOVE_TOP_SUBID="move-top";this._REORDER_BUTTON_MOVE_UP_SUBID="move-up";this._REORDER_BUTTON_MOVE_DOWN_SUBID="move-down";this._REORDER_BUTTON_MOVE_BOTTOM_SUBID="move-bottom";this._REORDER_BUTTON_MOVE_TOP="TOP";this._REORDER_BUTTON_MOVE_UP="UP";this._REORDER_BUTTON_MOVE_DOWN="DOWN";this._REORDER_BUTTON_MOVE_BOTTOM=
"BOTTOM";this._DELETE_WARNING_POPUP_SUBID="DWPop";this._DELETE_WARNING_DLG_SUBID="DWD";this._DELETE_WARNING_MSG_SUBID="DWDMsg";this._MSG_SAVED_SEARCH_DELETE_WARNING="af_query.MSG_SAVED_SEARCH_DELETE_WARNING";this._OVERRIDE_WARNING_POPUP_SUBID="OWPop";this._OVERRIDE_WARNING_DLG_SUBID="OWD";this._OVERRIDE_WARNING_MSG_SUBID="OWDMsg";this._MSG_SAVED_SEARCH_OVERRIDE_WARNING="af_query.MSG_SAVED_SEARCH_OVERRIDE_WARNING";this._OVERRIDE_ERROR_POPUP_SUBID="OEPop";this._OVERRIDE_ERROR_DLG_SUBID="OED";this._OVERRIDE_ERROR_MSG_SUBID=
"OEDMsg";this._MSG_SAVED_SEARCH_OVERRIDE_ERROR="af_query.MSG_SAVED_SEARCH_OVERRIDE_ERROR";this._CSSPOPUP_SUBID="SSPop";this._CSSDLG_SUBID="SSD";this._CSSDLG_SSEARCH_NAME_SUBID="SS_name";this._CSSDLG_UIHINT_SAVERESULTLAYOUT_SUBID="SS_SL";this._CSSDLG_UIHINT_AUTOEXECUTE_SUBID="SS_autoEx";this._CSSDLG_UIHINT_DEFAULT_SUBID="SS_def";this._PERSONALIZE_SSEARCH_KEY="pzSSearch_key";this._SEPARATOR_KEY="SEPARATOR";this._NAMING_SEP=":";this._INDEXED_FIELD="_afrIndexed";this._UIHINT_AUTOEXECUTE="autoExecute";
this._UIHINT_DEFAULT="default";this._UIHINT_NAME="name";this._UIHINT_SAVE_RESULTS_LAYOUT="saveResultsLayout";this._UIHINT_SHOW_IN_LIST="showInList";this._PSS_POPUP_VISIBLE_STATUS="_afrPSSVisibleStatus";this._BUSY="_busy";var a=AdfPage.PAGE.getLookAndFeel();this._skinVisibileItems=parseInt(a.getSkinProperty("af|query-tr-visible-items"));"undefined"!=typeof a.getSkinProperty("af|query-tr-button-type")&&(this._usesUnifiedButtons="old"!=a.getSkinProperty("af|query-tr-button-type"));this._usesUnifiedButtonsInDialog=
"old"!=a.getSkinProperty("af|dialog-tr-button-type");AdfDhtmlQueryPeer.prototype._handleDisclosureEvent=function(a,d){AdfQueryInternalEvent.queue(this.getComponent(),AdfQueryInternalEvent.OPERATION_DISCLOSE,d,!0);AdfAgent.AGENT.preventDefault(a)}};AdfDhtmlQueryPeer.prototype.ComponentDisclosedChanged=function(a,b,d,e){return this._getContentDomElement()?this._disclosurePeer.ComponentDisclosedChanged(a,b,d,e):!1};AdfDhtmlQueryPeer.prototype._getContentDomElement=function(){return this.getDomElement().childNodes[1]};
AdfDhtmlQueryPeer.prototype.InitDomElement=function(a,b){AdfDhtmlQueryPeer.superclass.InitDomElement.call(this,a,b);return AdfPage.PAGE.scheduleTimer(this,this._setAddFieldsVisibleItems,a,0,{isSynchronized:!0})};AdfDhtmlQueryPeer.prototype.SetBusy=function(a){var b=this.getComponent();b&&b.setProperty(AdfDhtmlQueryPeer._BUSY,a,!1,AdfUIComponent.PROPAGATE_NEVER)};
AdfDhtmlQueryPeer.prototype.ResizeNotify=function(a,b,d,e){this._isHeaderless(this.getComponent())||AdfDhtmlQueryPeer.superclass.ResizeNotify.call(this,a,b,d,e)};AdfDhtmlQueryPeer.prototype.__handleClientSideDisclosure=function(a){var b=this._getContentDomElement();return b?(b.style.display=a?"":"none",!0):!1};AdfDhtmlQueryPeer.prototype.HandleComponentDisclosure=function(a){this._disclosurePeer.HandleComponentDisclosure(a)};
AdfDhtmlQueryPeer.prototype.HandleComponentClick=function(a){var b=this.getComponent().getProperty(AdfDhtmlQueryPeer._BUSY);a.isCanceled()||!a.isLeftButtonPressed()||b||this._handleComponentOperation(a);this._disclosurePeer&&this._disclosurePeer.HandleComponentClick(a)};
AdfDhtmlQueryPeer.prototype.HandleComponentKeyUp=function(a){if(a.getKeyCode()==AdfKeyStroke.SPACE_KEY){var b=this._handleComponentOperation(a);if(!b){var d=this._isClickInReorderDialogButtons(a);d&&(this._handleClickOnReorderButtons(a,d),b=!0)}if(b){a.cancel();return}}this._isEnterKeyNotConsumed(a)&&!this._isEventTargetInChoiceComponent(a)&&this._enterKeyDownSrc==a.getNativeEventTarget()&&(this.validateCriterionFields()&&this._queueQueryEvent(this.getComponent()),a.cancel());this._disclosurePeer&&
this._disclosurePeer.HandleComponentKeyUp(a);this._enterKeyDownSrc=null};AdfDhtmlQueryPeer.prototype.HandleComponentKeyDown=function(a){this.getDomElement().setAttribute("tabindex",-1);this._isEnterKeyNotConsumed(a)&&(this._enterKeyDownSrc=a.getNativeEventTarget(),a.stopBubbling(),AdfAgent.AGENT.stopPropagation(a.getNativeEvent()))};AdfDhtmlQueryPeer.prototype.HandleComponentKeyPress=function(a){this._isEnterKeyNotConsumed(a)&&a.cancel()};
AdfDhtmlQueryPeer.prototype.HandleComponentPopupOpening=function(a){a=a.getSource();var b=this.getComponent().getClientId();a.getClientId()==AdfRichUIPeer.CreateSubId(b,AdfDhtmlQueryPeer._PSSPOPUP_SUBID)&&(a=this._getPopupComponent(b,!0),this.getComponent().setProperty(AdfDhtmlQueryPeer._PSS_POPUP_VISIBLE_STATUS,a.getClientId(),!0,AdfUIComponent.PROPAGATE_ALWAYS))};
AdfDhtmlQueryPeer.prototype._checkDefaultSavedSearchHidden=function(a,b){var d=AdfRichUIPeer.CreateSubId(b,AdfDhtmlQueryPeer._PSSDLG_UIHINT_SHOWINLIST_SUBID),d=AdfPage.PAGE.findComponent(d).getValue(),e=AdfRichUIPeer.CreateSubId(b,AdfDhtmlQueryPeer._PSSDLG_UIHINT_DEFAULT_SUBID);return AdfPage.PAGE.findComponent(e).getValue()&&!d?(this._setComponentError(a,"af_query.LABEL_PERSONALIZE_SAVED_SEARCHES_SHOWINLIST","af_query.LABEL_PERSONALIZE_SAVED_SEARCHES_SHOWINLIST_DETAIL"),!0):!1};
AdfDhtmlQueryPeer.prototype.HandleComponentAction=function(a){var b=this.getComponent(),d=b.getClientId(),e=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._APPLY_BUTTON_SUBID),f=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._DELETE_BUTTON_SUBID),g=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._REORDER_BUTTON_SUBID),h=d+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._REORDER_BUTTON_MOVE_UP_SUBID,k=d+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._REORDER_BUTTON_MOVE_TOP_SUBID,l=d+AdfDhtmlQueryPeer._NAMING_SEP+
AdfDhtmlQueryPeer._REORDER_BUTTON_MOVE_DOWN_SUBID,m=d+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._REORDER_BUTTON_MOVE_BOTTOM_SUBID,n=d+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._ADDFIELDS_SUBID,q=d+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._ADDFIELDS_GROUP_MENU_ADDALL_ITEM_SUBID,r=a.getSource().getClientId(),t=AdfPage.PAGE.findComponent(r);if(r==e)this._passSavedSearchNameCheck(b,!0)?(r=AdfPage.PAGE.findComponent(d+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._PSSDLG_ID),this._checkDefaultSavedSearchHidden(r,
d)?a.cancel():this._getSelectedSearchName(b,!0)&&(value=this._getCreateOrUpdateValue(b,AdfDhtmlQueryPeer._PSSDLG_SUBID),AdfQueryInternalEvent.queue(b,AdfQueryInternalEvent.OPERATION_UPDATE,value,!0))):a.cancel();else if(r==g||r==h||r==k||r==l||r==m)a.cancel();else if(r==f)a.cancel();else if(-1!=r.indexOf(n)||-1!=r.indexOf(q))d={},d.sourceId=r,d.selectedText=t.getProperty("selectedText"),AdfQueryOperationEvent.queue(b,AdfQueryOperationEvent.OPERATION_ADDFIELDS,d,!0),a.stopBubbling(),a.cancel()};
AdfDhtmlQueryPeer.prototype.HandleComponentDialog=function(a){var b=this.getComponent(),d=b.getClientId(),e,f,g=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._DELETE_WARNING_DLG_SUBID),h=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._OVERRIDE_WARNING_DLG_SUBID),k=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._OVERRIDE_ERROR_DLG_SUBID),l=a.getSource().getClientId();AdfDhtmlQueryPeer._usesUnifiedButtonsInDialog?(f=d+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._PSSDLG_ID,e=d+AdfDhtmlQueryPeer._NAMING_SEP+
AdfDhtmlQueryPeer._SSDLG_ID):(e=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._CSSDLG_SUBID),f=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._PSSDLG_SUBID));f=l==f;e=l==e;g=l==g;h=l==h;k=l==k;if(e||f){g=!0;if(a.getOutcome()==AdfDialogEvent.OUTCOME_OK)if(g=this._passSavedSearchNameCheck(b,f))if(k=this._getCreateOrUpdateValue(b,f?AdfDhtmlQueryPeer._PSSDLG_SUBID:AdfDhtmlQueryPeer._CSSDLG_SUBID),e)AdfQueryOperationEvent.queue(b,AdfQueryOperationEvent.OPERATION_CREATE,k,!0);else{if(this._checkDefaultSavedSearchHidden(b,
d)){a.cancel();return}(selectedSearch=this._getSelectedSearchName(b,!0))?AdfQueryOperationEvent.queue(b,AdfQueryOperationEvent.OPERATION_UPDATE,k,!0):AdfQueryInternalEvent.queue(b,AdfQueryInternalEvent.OPERATION_CANCEL,!0,!0)}else{if(e){this._passSystemSearchNameCheck(this._getSearchNameInCSSDialog(b))?this._showWarningPopup(!1,!1):this._showWarningPopup(!1,!0);a.cancel();return}}else AdfQueryInternalEvent.queue(b,AdfQueryInternalEvent.OPERATION_CANCEL,f,!0);a.cancel();g&&this.HidePopupDialog(d,f)}else if(g||
h||k)l=!1,(l=a.getOutcome()==AdfDialogEvent.OUTCOME_YES)&&!k&&(e=g?AdfQueryOperationEvent.OPERATION_DELETE:AdfQueryOperationEvent.OPERATION_OVERRIDE,(k=this._getCreateOrUpdateValue(b,g?AdfDhtmlQueryPeer._PSSDLG_SUBID:AdfDhtmlQueryPeer._CSSDLG_SUBID))?AdfQueryOperationEvent.queue(b,e,k,!0):(b=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._PSSDLG_SSEARCH_CHOICE_SUBID),b=AdfPage.PAGE.findComponent(b),this._setComponentError(b,"af_query.MSG_SAVED_SEARCH_DELDUP_CONSTRAINT","af_query.MSG_SAVED_SEARCH_DELETE_CONSTRAINT_DETAIL"))),
a.cancel(),(a=this._getWarningPopupComponent(g,h))&&a.hide(),h&&l&&this.HidePopupDialog(d,f);else if(l==d+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._REORDER_DIALOG_SUBIID||l==d+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._REORDER_DIALOG_SUBIID)a.getOutcome()==AdfDialogEvent.OUTCOME_OK?(AdfQueryOperationEvent.queue(b,AdfQueryOperationEvent.OPERATION_REORDER_FIELDS,null,!0),a.cancel(),(popupComp=a.getSource().getParent())&&popupComp.hide()):a.getOutcome()==AdfDialogEvent.OUTCOME_CANCEL&&
AdfQueryInternalEvent.queue(b,AdfQueryInternalEvent.OPERATION_REORDER_CANCEL,null,!0)};
AdfDhtmlQueryPeer.prototype.HandleComponentValueChange=function(a){var b=a.getSource().getClientId();if(b){var d=AdfPage.PAGE.findComponent(b),e=this.getComponent(),f=e.getClientId(),g=AdfRichUIPeer.CreateSubId(f,AdfDhtmlQueryPeer._SSEARCH_CHOICE_SUBID),f=AdfRichUIPeer.CreateSubId(f,AdfDhtmlQueryPeer._PSSDLG_SSEARCH_CHOICE_SUBID);b==g?(b=d.getValue())&&""!=b?b==AdfDhtmlQueryPeer._PERSONALIZE_SSEARCH_KEY?AdfQueryInternalEvent.queue(e,AdfQueryInternalEvent.OPERATION_SHOW_POPUP,!0,!0):b!=AdfDhtmlQueryPeer._SEPARATOR_KEY&&
AdfQueryOperationEvent.queue(e,AdfQueryOperationEvent.OPERATION_SELECT,b,!0):a.cancel():b==f&&((b=d.getValue())&&b!=AdfDhtmlQueryPeer._SEPARATOR_KEY?AdfQueryInternalEvent.queue(e,AdfQueryInternalEvent.OPERATION_SELECT,b,!0):a.cancel())}};AdfDhtmlQueryPeer.prototype.HidePopupDialog=function(a,b){var d=this._getPopupComponent(a,b);d&&(b&&this.getComponent().setProperty(AdfDhtmlQueryPeer._PSS_POPUP_VISIBLE_STATUS,null,!0,AdfUIComponent.PROPAGATE_ALWAYS),d.hide())};
AdfDhtmlQueryPeer.prototype.PopupClosed=function(a,b){AdfDhtmlQueryPeer.superclass.PopupClosed.call(this,a,b);var d=a.getClientId(),e=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._CSSPOPUP_SUBID),f=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._PSSPOPUP_SUBID),g=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._DELETE_WARNING_POPUP_SUBID),h=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._OVERRIDE_WARNING_POPUP_SUBID),k=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._OVERRIDE_ERROR_POPUP_SUBID),e=AdfAgent.AGENT.getElementById(e),
f=AdfAgent.AGENT.getElementById(f),g=AdfAgent.AGENT.getElementById(g),h=AdfAgent.AGENT.getElementById(h),k=AdfAgent.AGENT.getElementById(k),l,m,n=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._DELETE_WARNING_DLG_SUBID),q=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._OVERRIDE_WARNING_DLG_SUBID),r=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._OVERRIDE_ERROR_DLG_SUBID);AdfDhtmlQueryPeer._usesUnifiedButtonsInDialog?(m=d+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._PSSDLG_ID,l=d+AdfDhtmlQueryPeer._NAMING_SEP+
AdfDhtmlQueryPeer._SSDLG_ID):(l=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._CSSDLG_SUBID),m=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._PSSDLG_SUBID));b.id==l?e.appendChild(b):b.id==m?f.appendChild(b):b.id==n?g.appendChild(b):b.id==q?h.appendChild(b):b.id==r&&k.appendChild(b)};AdfDhtmlQueryPeer.getSavedSearchNames=function(){return AdfDhtmlQueryPeer.getUserSavedSearchNames().concat(AdfDhtmlQueryPeer.getSystemSavedSearchNames())};
AdfDhtmlQueryPeer.setUserSavedSearchNames=function(a){this._existingUserSearchNames=a};AdfDhtmlQueryPeer.getUserSavedSearchNames=function(){var a=this._existingUserSearchNames;return a?a:[]};AdfDhtmlQueryPeer.setSystemSavedSearchNames=function(a){this._existingSystemSearchNames=a};AdfDhtmlQueryPeer.getSystemSavedSearchNames=function(){var a=this._existingSystemSearchNames;return a?a:[]};
AdfDhtmlQueryPeer.prototype._isHeaderless=function(a){AdfAssert.assert(null!=a,"AdfDhtmlQueryPeer.prototype._isHeaderless, component cannot be null!");a=a.getDisplayMode();return"simple"==a||"design"==a};
AdfDhtmlQueryPeer.prototype._getCreateOrUpdateValue=function(a,b){var d=null,e=null,f=null,g=null,h=null,k=a.getClientId();b==AdfDhtmlQueryPeer._CSSDLG_SUBID?(d=AdfRichUIPeer.CreateSubId(AdfRichUIPeer.CreateSubId(k,AdfDhtmlQueryPeer._CSSDLG_SSEARCH_NAME_SUBID),AdfDhtmlQueryPeer.CONTENT_SUBID),e=AdfRichUIPeer.CreateSubId(AdfRichUIPeer.CreateSubId(k,AdfDhtmlQueryPeer._CSSDLG_UIHINT_AUTOEXECUTE_SUBID),AdfDhtmlQueryPeer.CONTENT_SUBID),f=AdfRichUIPeer.CreateSubId(AdfRichUIPeer.CreateSubId(k,AdfDhtmlQueryPeer._CSSDLG_UIHINT_DEFAULT_SUBID),
AdfDhtmlQueryPeer.CONTENT_SUBID),h=this._getSelectedSearchName(a,!1)):b==AdfDhtmlQueryPeer._PSSDLG_SUBID&&(d=AdfRichUIPeer.CreateSubId(AdfRichUIPeer.CreateSubId(k,AdfDhtmlQueryPeer._PSSDLG_SSEARCH_NAME_SUBID),AdfDhtmlQueryPeer.CONTENT_SUBID),e=AdfRichUIPeer.CreateSubId(AdfRichUIPeer.CreateSubId(k,AdfDhtmlQueryPeer._PSSDLG_UIHINT_AUTOEXECUTE_SUBID),AdfDhtmlQueryPeer.CONTENT_SUBID),g=AdfRichUIPeer.CreateSubId(AdfRichUIPeer.CreateSubId(k,AdfDhtmlQueryPeer._PSSDLG_UIHINT_SHOWINLIST_SUBID),AdfDhtmlQueryPeer.CONTENT_SUBID),
f=AdfRichUIPeer.CreateSubId(AdfRichUIPeer.CreateSubId(k,AdfDhtmlQueryPeer._PSSDLG_UIHINT_DEFAULT_SUBID),AdfDhtmlQueryPeer.CONTENT_SUBID),h=this._getSelectedSearchName(a,!0));k={};h&&(k.selectedSearch=h);if(d=AdfAgent.AGENT.getElementById(d))k[AdfDhtmlQueryPeer._UIHINT_NAME]=d.value;e=AdfAgent.AGENT.getElementById(e);k[AdfDhtmlQueryPeer._UIHINT_AUTOEXECUTE]=e?e.checked:!0;f=AdfAgent.AGENT.getElementById(f);k[AdfDhtmlQueryPeer._UIHINT_DEFAULT]=f?f.checked:!1;g&&(g=AdfAgent.AGENT.getElementById(g),k[AdfDhtmlQueryPeer._UIHINT_SHOW_IN_LIST]=
g?g.checked:!1);return k};AdfDhtmlQueryPeer.prototype._getSSNameComponent=function(a,b){AdfAssert.assertBoolean(b);var d=null,d=b?AdfRichUIPeer.CreateSubId(a,AdfDhtmlQueryPeer._PSSDLG_SSEARCH_NAME_SUBID):AdfRichUIPeer.CreateSubId(a,AdfDhtmlQueryPeer._CSSDLG_SSEARCH_NAME_SUBID);return AdfPage.PAGE.findComponent(d)};
AdfDhtmlQueryPeer.prototype._getPopupComponent=function(a,b){var d=null,d=null,d=b?AdfDhtmlQueryPeer._PSSPOPUP_SUBID:AdfDhtmlQueryPeer._CSSPOPUP_SUBID,d=AdfRichUIPeer.CreateSubId(a,d);return d=AdfPage.PAGE.findComponent(d)};
AdfDhtmlQueryPeer.prototype._getWarningPopupComponent=function(a,b){var d=this.getComponent().getClientId(),d=AdfRichUIPeer.CreateSubId(d,a?AdfDhtmlQueryPeer._DELETE_WARNING_POPUP_SUBID:b?AdfDhtmlQueryPeer._OVERRIDE_WARNING_POPUP_SUBID:AdfDhtmlQueryPeer._OVERRIDE_ERROR_POPUP_SUBID);return AdfPage.PAGE.findComponent(d)};
AdfDhtmlQueryPeer.prototype._getQueryButtonId=function(a){var b=this.getComponent().getClientId();return AdfDhtmlQueryPeer._usesUnifiedButtons?b+":_"+a:AdfRichUIPeer.CreateSubId(b,a)};
AdfDhtmlQueryPeer.prototype._handleComponentOperation=function(a){var b=this.getComponent(),d=b.getClientId(),e=this._getQueryButtonId(AdfDhtmlQueryPeer._MODE_BUTTON_SUBID),f=this._getQueryButtonId(AdfDhtmlQueryPeer._SEARCH_BUTTON_SUBID),g=this._getQueryButtonId(AdfDhtmlQueryPeer._RESET_BUTTON_SUBID),h=this._getQueryButtonId(AdfDhtmlQueryPeer._SAVE_BUTTON_SUBID),k=d+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._REORDER_BUTTON_SUBID,d=AdfAgent.getAgent(),l=a.getNativeEvent(),l=d.getEventTarget(l),
d=!1,m=null;if(AdfDhtmlQueryPeer._usesUnifiedButtons){var n=AdfRichUIPeer.getFirstAncestorComponent(l);n instanceof AdfRichButton&&(m=n.getClientId(),1==n.getDisabled()&&(d=!0))}else m=l.id,1==l.disabled&&(d=!0);if(!d)if(m==f&&this.validateCriterionFields())this._queueQueryEvent(b),d=!0;else if(m==e)(new AdfQueryOperationEvent(b,AdfQueryOperationEvent.OPERATION_MODE_CHANGE,null)).queue(!0);else if(m==g){if(e=b.getDescendantComponents())for(f=AdfPage.PAGE.getAllMessages(),g=0;g<e.length;g++)h=e[g],
(k=h.getClientId())&&0<=k.indexOf(AdfDhtmlQueryPeer._CRITERION_VALUE_SUBID)&&f[k]&&h.setValue();AdfQueryOperationEvent.queue(b,AdfQueryOperationEvent.OPERATION_RESET,!1,!0)}else m==h?AdfQueryInternalEvent.queue(b,AdfQueryInternalEvent.OPERATION_SHOW_POPUP,!1,!0):this._isClickInClientComponent(l,AdfDhtmlQueryPeer._CONJUNCTION_SUBID)?this._handleConjunctionSelection(b,a):m==k?AdfQueryInternalEvent.queue(b,AdfQueryInternalEvent.OPERATION_REORDER_DIALOG_OPEN,null,!0):this._handleComponentClickInDialog(a);
d&&(a.cancel(),a.stopBubbling());return d};AdfDhtmlQueryPeer.prototype._queueResultComponentEvent=function(a){if(-1==a.getClientId().indexOf("_afrLovInternalQueryId")){var b=a.getResultComponentId();b&&(a=a.findComponent(b))&&AdfQueryInternalEvent.queue(a,AdfQueryInternalEvent.OPERATION_RESULT_COMPONENT_DECODE,null,!0)}};
AdfDhtmlQueryPeer.prototype._showWarningPopup=function(a,b){var d=this.getComponent(),e=d.getClientId(),f=AdfRichUIPeer.CreateSubId(e,a?AdfDhtmlQueryPeer._DELETE_WARNING_MSG_SUBID:b?AdfDhtmlQueryPeer._OVERRIDE_WARNING_MSG_SUBID:AdfDhtmlQueryPeer._OVERRIDE_ERROR_MSG_SUBID);if(f=AdfPage.PAGE.findComponent(f))d=a?this._getSelectedSearchName(d,!0):this._getSearchNameInCSSDialog(d),d=AdfPage.PAGE.getLookAndFeel().getTranslatedString(a?AdfDhtmlQueryPeer._MSG_SAVED_SEARCH_DELETE_WARNING:b?AdfDhtmlQueryPeer._MSG_SAVED_SEARCH_OVERRIDE_WARNING:
AdfDhtmlQueryPeer._MSG_SAVED_SEARCH_OVERRIDE_ERROR,d),f.setValue(d);f=this._getWarningPopupComponent(a,b);e=AdfRichUIPeer.CreateSubId(e,a?AdfDhtmlQueryPeer._PSSDLG_SSEARCH_NAME_SUBID:AdfDhtmlQueryPeer._CSSDLG_SSEARCH_NAME_SUBID);f.show({align:AdfRichPopup.ALIGN_AFTER_START,alignId:e})};AdfDhtmlQueryPeer.prototype._getSearchNameInCSSDialog=function(a){a=a.getClientId();return(a=this._getSSNameComponent(a,!1))?a.getValue():null};
AdfDhtmlQueryPeer.prototype._getSelectedSearchName=function(a,b){var d=a.getClientId(),e=null,e=b?AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._PSSDLG_SSEARCH_CHOICE_SUBID):AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._SSEARCH_CHOICE_SUBID);return(d=AdfPage.PAGE.findComponent(e))?d.getValue():null};
AdfDhtmlQueryPeer.prototype._handleCheckboxClick=function(a,b){var d=AdfPage.PAGE.findComponent(b),e=AdfAgent.AGENT.getElementById(b);if(d){var f=d.getPeer();f.HandleComponentClick(a);var g=d.getValue();g&&f.SetDisplayValue(d,e,g)}};
AdfDhtmlQueryPeer.prototype._handleComponentClickInDialog=function(a){var b=this.getComponent(),d=b.getClientId(),e=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._DELETE_BUTTON_SUBID),f=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._DUPLICATE_BUTTON_SUBID),g=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._APPLY_BUTTON_SUBID),h=a.getSource().getClientId();h==e?this._showWarningPopup(!0,!1):h==f?(e=this._getCreateOrUpdateValue(b,AdfDhtmlQueryPeer._PSSDLG_SUBID))?AdfQueryOperationEvent.queue(b,AdfQueryOperationEvent.OPERATION_DUPLICATE,
e,!0):(b=AdfRichUIPeer.CreateSubId(d,AdfDhtmlQueryPeer._PSSDLG_SSEARCH_CHOICE_SUBID),b=AdfPage.PAGE.findComponent(b),this._setComponentError(b,"af_query.MSG_SAVED_SEARCH_DELDUP_CONSTRAINT","af_query.MSG_SAVED_SEARCH_DUPLICATE_CONSTRAINT_DETAIL"),a.cancel()):h==g?a.cancel():this._isCheckboxClicked(a,AdfDhtmlQueryPeer._PSSDLG_SUBID,h)?this._handleCheckboxClick(a,h):this._isCheckboxClicked(a,AdfDhtmlQueryPeer._CSSDLG_SUBID,h)?this._handleCheckboxClick(a,h):(b=this._isClickInReorderDialogButtons(a))&&
this._handleClickOnReorderButtons(a,b)};
AdfDhtmlQueryPeer.prototype._isClickInReorderDialogButtons=function(a){var b=AdfAgent.getAgent();a=a.getNativeEvent();b=b.getEventTarget(a);return this._isClickInClientComponent(b,AdfDhtmlQueryPeer._REORDER_BUTTON_MOVE_TOP_SUBID)?AdfDhtmlQueryPeer._REORDER_BUTTON_MOVE_TOP:this._isClickInClientComponent(b,AdfDhtmlQueryPeer._REORDER_BUTTON_MOVE_UP_SUBID)?AdfDhtmlQueryPeer._REORDER_BUTTON_MOVE_UP:this._isClickInClientComponent(b,AdfDhtmlQueryPeer._REORDER_BUTTON_MOVE_DOWN_SUBID)?AdfDhtmlQueryPeer._REORDER_BUTTON_MOVE_DOWN:
this._isClickInClientComponent(b,AdfDhtmlQueryPeer._REORDER_BUTTON_MOVE_BOTTOM_SUBID)?AdfDhtmlQueryPeer._REORDER_BUTTON_MOVE_BOTTOM:!1};AdfDhtmlQueryPeer.prototype._handleClickOnReorderButtons=function(a,b){this.getComponent().getClientId();AdfQueryInternalEvent.queue(this.getComponent(),AdfQueryInternalEvent.OPERATION_REORDER_BUTTON,b,!0)};
AdfDhtmlQueryPeer.prototype._handleConjunctionSelection=function(a,b){var d=a.getClientId()+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._CONJUNCTION_SUBID,e=AdfPage.PAGE.findComponent(d);if(e){var d=AdfAgent.AGENT.getElementById(d),f=e.getPeer();e.setProperty("value",d.value);f.HandleComponentClick(b);var g=e.getValue();g&&f.SetDisplayValue(e,d,g);AdfQueryInternalEvent.queue(a,AdfQueryInternalEvent.OPERATION_SELECT_CONJUNCTION,g,!0)}else b.cancel()};
AdfDhtmlQueryPeer.prototype._isCheckboxClicked=function(a,b,d){a=a.getSource().getProperty("readOnly");if("true"==a||1==a)return!1;a=this.getComponent().getClientId();if(b==AdfDhtmlQueryPeer._PSSDLG_SUBID){b=AdfRichUIPeer.CreateSubId(a,AdfDhtmlQueryPeer._PSSDLG_UIHINT_AUTOEXECUTE_SUBID);var e=AdfRichUIPeer.CreateSubId(a,AdfDhtmlQueryPeer._PSSDLG_UIHINT_DEFAULT_SUBID);a=AdfRichUIPeer.CreateSubId(a,AdfDhtmlQueryPeer._PSSDLG_UIHINT_SHOWINLIST_SUBID);return d==b||d==e||d==a}return b==AdfDhtmlQueryPeer._CSSDLG_SUBID?
(b=AdfRichUIPeer.CreateSubId(a,AdfDhtmlQueryPeer._CSSDLG_UIHINT_AUTOEXECUTE_SUBID),e=AdfRichUIPeer.CreateSubId(a,AdfDhtmlQueryPeer._CSSDLG_UIHINT_DEFAULT_SUBID),a=AdfRichUIPeer.CreateSubId(a,AdfDhtmlQueryPeer._CSSDLG_UIHINT_SAVERESULTLAYOUT_SUBID),d==b||d==e||d==a):!1};AdfDhtmlQueryPeer.prototype._isClickInSubComponent=function(a,b){var d=this.getComponent().getClientId(),d=AdfRichUIPeer.CreateSubId(d,b),e=a.id;return e==d||0<=e.indexOf(d)?!0:!1};
AdfDhtmlQueryPeer.prototype._isClickInClientComponent=function(a,b){var d=this.getComponent().getClientId()+AdfDhtmlQueryPeer._NAMING_SEP+b;return a&&0<=a.id.indexOf(d)?!0:a.parentNode&&a.parentNode.id&&0<=a.parentNode.id.indexOf(d)?!0:!1};AdfDhtmlQueryPeer.prototype._passSystemSearchNameCheck=function(a){var b=!1,d=AdfDhtmlQueryPeer.getSystemSavedSearchNames();a=AdfStrings.trim(a.toLowerCase());for(var e=0;e<d.length;e++)if(AdfStrings.trim(d[e].toLowerCase())==a){b=!0;break}return b};
AdfDhtmlQueryPeer.prototype._passSavedSearchNameCheck=function(a,b){var d=!0,e=a.getClientId(),f=AdfRichUIPeer.CreateSubId(e,b?AdfDhtmlQueryPeer._PSSDLG_SSEARCH_NAME_SUBID:AdfDhtmlQueryPeer._CSSDLG_SSEARCH_NAME_SUBID);if(f=AdfPage.PAGE.findComponent(f)){if(f.getDisabled())return!0;var g=f.getValue();if(f.IsEmpty(g))return this._setComponentError(f,"af_query.MSG_SAVED_SEARCH_NAME_NOTNULL_CONSTRAINT","af_query.MSG_SAVED_SEARCH_NAME_NOTNULL_CONSTRAINT_DETAIL"),!1;if(b){var h=this._getSelectedSearchName(a,
b);if(g==h)return!0}e=AdfRichUIPeer.CreateSubId(e,b?AdfDhtmlQueryPeer._PSSDLG_SSEARCH_CHOICE_SUBID:AdfDhtmlQueryPeer._SSEARCH_CHOICE_SUBID);e=AdfPage.PAGE.findComponent(e).getSelectItems();g=AdfStrings.trim(g.toLowerCase());for(h=0;h<e.length;h++)if(AdfStrings.trim(e[h].getValue().toLowerCase())==g&&!e[h].isDisabled()){d=!1;b&&this._setComponentError(f,"af_query.MSG_SAVED_SEARCH_NAME_UNIQUE_CONSTRAINT","af_query.MSG_SAVED_SEARCH_NAME_UNIQUE_CONSTRAINT_DETAIL");break}}return d};
AdfDhtmlQueryPeer.prototype._setComponentError=function(a,b,d,e){AdfAssert.assertString(b);AdfAssert.assertStringOrNull(d);e?(b=TrMessageFactory.getString(b),d=TrMessageFactory.getString(d)):(e=AdfPage.PAGE.getLookAndFeel(),b=e.getTranslatedString(b),d=e.getTranslatedString(d));d=new AdfFacesMessage(AdfFacesMessage.TYPE_ERROR,b,d);b=AdfPage.PAGE;a?(e=a.getClientId(),b.clearMessages(e),b.addMessage(e,d),a.focus()):b.addMessage(null,d)};
AdfDhtmlQueryPeer.prototype._isEnterKeyNotConsumed=function(a){return a.isCanceled()||a.getKeyCode()!=AdfKeyStroke.ENTER_KEY||null==AdfDhtmlFormPeer.__GetDefaultCommandTriggerId(a,!1)?!1:!0};
AdfDhtmlQueryPeer.prototype._isEventTargetInChoiceComponent=function(a){var b=AdfAgent.getAgent();a=a.getNativeEvent();b=b.getEventTarget(a);return this._isClickInSubComponent(b,AdfDhtmlQueryPeer._SSEARCH_CHOICE_SUBID)||this._isClickInSubComponent(b,AdfDhtmlQueryPeer._PSSDLG_SSEARCH_CHOICE_SUBID)||this._isClickInClientComponent(b,AdfDhtmlQueryPeer._OPERATOR_DROPDOWN_SUBID)};
AdfDhtmlQueryPeer.prototype.validateCriterionFields=function(){var a=this.getComponent(),b=a.getDescendantComponents();if(b){for(var d=!0,e=[],f=0,g=!0,h=!0,k=!0,l=0;l<b.length;l++){var m=b[l],n=m.getId(),q=AdfRichUIPeer.getDomElementForComponent(m);n&&0<=n.indexOf(AdfDhtmlQueryPeer._CRITERION_VALUE_SUBID)&&q&&AdfDomUtils.isInVisibleSubtree(q)&&(0==m.getValid()&&(g=!1),m.getShowRequired&&m.getShowRequired()&&g&&(q=m.getValue(),q&&""!=q||0===q||(this._setComponentError(m,"org.apache.myfaces.trinidad.UIXEditableValue.REQUIRED",
"org.apache.myfaces.trinidad.UIXEditableValue.REQUIRED_detail",!0),h=!1)),n=n.substring(AdfDhtmlQueryPeer._CRITERION_VALUE_SUBID.length,n.length-1))&&(n=a.getClientId()+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._CRITERION_SUBID+n,(n=AdfAgent.getAgent().getElementById(n))&&n.getAttribute(AdfDhtmlQueryPeer._INDEXED_FIELD)&&(q=m.getValue(),e[f++]=m,d=q&&""!=q||0===q?!1:d&&!0))}if(d&&0<f){for(a=0;a<f;a++)this._setComponentError(e[a],"af_query.MSG_SELECTIVELY_REQUIRED_CONSTRAINT","af_query.MSG_SELECTIVELY_REQUIRED_CONSTRAINT_DETAIL",
!1);k=!1}else for(a=0;a<f;a++)b=e[a],d=b.getClientId(),AdfPage.PAGE.clearMessages(d),b.validate(),0==b.getValid()&&(g=!1);g||AdfPage.PAGE.showMessages();return k&&h&&g}return!0};AdfDhtmlQueryPeer.prototype._getPageProperty=function(a){var b=this.getComponent().getClientId(),d;(b=AdfPage.PAGE.getPageProperty(b))&&(d=b[a]);return d};
AdfDhtmlQueryPeer.prototype._setPageProperty=function(a,b){var d=this.getComponent().getClientId(),e=AdfPage.PAGE,f=e.getPageProperty(d);f||(f={},e.setPageProperty(d,f));f[a]=b};AdfDhtmlQueryPeer.prototype._clearPageProperty=function(a){var b=this.getComponent().getClientId(),d=AdfPage.PAGE,e=d.getPageProperty(b);e||(e={},d.setPageProperty(b,e));e[a]=null};
AdfDhtmlQueryPeer.prototype._setAddFieldsVisibleItems=function(a){a=a.getClientId()+AdfDhtmlQueryPeer._NAMING_SEP+AdfDhtmlQueryPeer._ADDFIELDS_MENU_ID;a=AdfPage.PAGE.findComponent(a);if(null!=a&&(a.getPeer().setVisibleItems(AdfDhtmlQueryPeer._skinVisibileItems),a=a.getDescendantComponents()))for(var b=0;b<a.length;b++){var d=a[b],e=d.getClientId();e&&0<=e.indexOf(AdfDhtmlQueryPeer._ADDFIELDS_GROUP_MENU_ID)&&d.getPeer().setVisibleItems(AdfDhtmlQueryPeer._skinVisibileItems)}};
AdfDhtmlQueryPeer.prototype._queueQueryEvent=function(a){AdfQueryUtils.queueQueryEvent(a);this._queueResultComponentEvent(a)};