AdfRichUIPeer.createPeerClass(AdfRichUIPeer,"AdfDhtmlTableBasePeer",!1);
AdfDhtmlTableBasePeer.InitSubclass=function(){AdfRichUIPeer.addDomEventHandlers(this,AdfDhtmlLookAndFeel.SCROLL_EVENT_TYPE,AdfDhtmlLookAndFeel.KEY_DOWN_EVENT_TYPE,AdfDhtmlLookAndFeel.MOUSE_MOVE_EVENT_TYPE);AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.CLICK_EVENT_TYPE,AdfUIInputEvent.MOUSE_DOWN_EVENT_TYPE,AdfUIInputEvent.MOUSE_UP_EVENT_TYPE,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE,AdfUIInputEvent.KEY_UP_EVENT_TYPE,AdfComponentEvent.FOCUS_EVENT_TYPE,AdfComponentEvent.BLUR_EVENT_TYPE,AdfUIInputEvent.DOUBLE_CLICK_EVENT_TYPE,
AdfComponentEvent.CONTEXT_MENU_EVENT_TYPE,AdfValueChangeEvent.VALUE_CHANGE_TYPE);AdfRichUIPeer.addComponentPropertyChanges(this,"selectedRowKeys","disclosedRowKeys","scrollTop","scrollLeft","activeRowKey");AdfRichUIPeer.addSuppressedPPRAttributes(this,"first");AdfRichUIPeer.addSuppressedPPRAttributes(this,"rows");AdfRichUIPeer.addSuppressedPPRAttributes(this,"scrollTop");AdfRichUIPeer.addSuppressedPPRAttributes(this,"scrollLeft");AdfRichUIPeer.addSuppressedPPRAttributes(this,"scrollTopRowKey");AdfRichUIPeer.addSuppressedPPRAttributes(this,
"activeRowKey");this._SEL_UPDATE_ALL_SELECT=0;this._SEL_UPDATE_ALL_UNSELECT=1;this._SEL_UPDATE_ALL_UPDATE=2;this.AUTO_PPR_UPDATE_BLOCK=0;this.AUTO_PPR_INSERT_BEFORE_BLOCK=1;this.AUTO_PPR_INSERT_AFTER_BLOCK=2;this.AUTO_PPR_REMOVE_BLOCK=3;this._COLUMN_FOOTER_FOCUS_TYPE=5;this.AUTO_PPR_FETCH_ID=-99;this.SCROLL_SUCCEEDED=0;this.SCROLL_INDEX_NOT_FOUND=1;this.SCROLL_CANCELLED=2;this.MISSING_AFTER=1;this.MISSING_BEFORE=2;this.NO_BLOCKS=4;this.VIEWPORT_SATISFIED=0;this.NO_SCROLL=-1;this.DW_SUB_ID="dataW";
this._CELL_TEXT_KEY="_afrCTK";this._ROW_KEY="_afrRK";this._ROW_HEADER="_afrRH";this._LEAF_COLUMN="_afrLeaf";this._ROOT_COLUMN="_afrRoot";this._FILTER_COLUMN="_afrFilterCol";this._PANEL_COLLECTION_ID="_afrPCId";this._SELECT_ALL="_afrSelAll";this._COL_COUNT="_afrColCount";this._FILTERABLE="_afrFilterable";this.__SORT_INDICATOR="afrSI";this._SORT_ASCENDING="_afrSortAsc";this._SORT_DESCENDING="_afrSortDesc";this._SORTED_TYPE="_afrSorted";AdfDhtmlTableBasePeer._REMAIN_READ_ONLY="_afrRemainReadOnly";this._SORTED_ASCENDING=
"1";this._SORTED_DESCENDING="2";this._SUPPORTS_HOVER="_afrHoverable";this.SELECTALL_KEY_PROPERTY="afrSelectAll";this._SELECTED_CLASS="p_AFSelected";this._INACTIVE_CLASS="p_AFInactive";this._DROP_TARGET_CLASS="p_AFDropTarget";this._HIGHLIGHTED_CLASS="p_AFHighlighted";this._FOCUSED_CLASS="p_AFFocused";this._AUTOSCROLL_MARGIN=40;this._HSCROLLER=0;this._VSCROLLER=1;this._SELECTION_SINGLE="single";this._SELECTION_MULTIPLE="multiple";this._SELECTION_MULTIPLE_NOSELECTALL="multipleNoSelectAll";this._SELECTION_NONE=
"none";this._EDIT_MODE_CLICKTOEDIT="clickToEdit";this._MAXIMUM_ROW_REVEAL=8;this._SELECT_PAGE_UP=1;this._SELECT_PAGE_DOWN=2;this._SELECT_ARROW_UP=3;this._SELECT_ARROW_DOWN=4;this._FOCUS_RH_ARROW_UP=5;this._FOCUS_RH_ARROW_DOWN=6;this._FOCUS_ROW_ARROW_UP=7;this._FOCUS_ROW_ARROW_DOWN=8;this._ROW_HEADER_FOCUS_TYPE=0;this._COLUMN_HEADER_FOCUS_TYPE=1;this._TABLE_BODY_FOCUS_TYPE=2;this._SELECT_ALL_FOCUS_TYPE=3;this._FILTER_CELL_FOCUS_TYPE=4;this._FETCH_MORE_CANVAS_SPACE=25;this._INPUT_REGEXP=/^INPUT|SELECT|OPTION|BUTTON|^A\b|TEXTAREA/;
this._TWINKLE_ON_STYLE_CLASS="p_AFTwinkleOn";this._TWINKLE_OFF_STYLE_CLASS="p_AFTwinkleOff";AdfDhtmlTableBasePeer._TWINKLE_TIMER_ID_ATTR="__afrTwinkleTimer";this._ICON_STYLE_EXPANDED="af|table::disclosed-icon-style";this._ICON_STYLE_COLLAPSED="af|table::undisclosed-icon-style";this._ICON_EXPANDED="af|table::disclosed-icon";this._ICON_COLLAPSED="af|table::undisclosed-icon";this._EXPANDED_NODE_KEY="af_table.TIP_EXPANDED_NODE";this._COLLAPSED_NODE_KEY="af_table.TIP_COLLAPSED_NODE";this._DETAIL_COLUMN_MARKER=
"_afrDetCol";this._DETAIL_ROW_MARKER="_afrDetRow";this._HAS_DETAIL_MARKER="_hasDetail";this.NEEDS_REFRESH_ATTRIBUTE="_afrNdsRfr";this.UNDO_FETCH_ATTRIBUTE="_afrUndFch";this.NO_RESIZE_MARKER="_noRsz";this._AUTO_HEIGHT_ROWS="_afrAutoHR";this._MAX_ROWHEADER_MSGTYPE_EXPANDO="_afrMRMT";this._CSS_HEIGHT_LIMIT=17E6;this._NAVBAR_FIRST="nb_fr";this._NAVBAR_PREVIOUS="nb_pv";this._NAVBAR_NEXT="nb_nx";this._NAVBAR_LAST="nb_ls";this._NAVBAR_PAGE="nb_pg";this._NAVBAR_PAGE_CNT="nb_cnt_pg";this._NAVBAR_PAGE_INPUT=
"nb_in_pg";this._NAVBAR_RANGE_TEXT="nb_rng";this.RERENDER_SELF="RERENDER_SELF";this.RERENDER_CELL="RERENDER_CELL";this.RERENDER_ROW="RERENDER_ROW";this.RERENDER_CONTAINER_CHILDREN="RERENDER_CONTAINER_CHILDREN";this.RERENDER_CONTAINER="RERENDER_CONTAINER";this._RERENDER_PRIORITY={RERENDER_SELF:0,RERENDER_CELL:1,RERENDER_ROW:2,RERENDER_CONTAINER_CHILDREN:3,RERENDER_CONTAINER:4};this._DEFAULT_MAX_CACHED_ROWS_FOR_TOUCH=300;this._MAX_CACHED_ROWS_FOR_TOUCH="_afrMaxTouchRows";this._DATAWRAPPER="dbw";this._SCROLLBAR_BEHAVIOR=
"_afrScrollBarBehavior";this._SCROLLBAR_BEHAVIOR_AUTOHIDE="autohiding-scrollbar";this._SCROLLBAR_AUTOHIDE_DATABODY_WRAPPER_CLASS="af|table::data-body-wrapper-autohiding-scrollbar";this._SCROLLBAR_AUTOHIDE_DATABODY_H_LINES_CLASS="af|table::data-body-H-lines-autohiding-scrollbar";this._SCROLLBAR_HEIGHT_TOLERANCE=3;this._TABLE_H_LINES_CLASS="af|table::data-table-H-lines";this._TABLE_VH_LINES_CLASS="af|table::data-table-VH-lines";this._IMPLICIT_LOAD_MORE="_afrImpldm";this._LOAD_MORE_TOP_DIV="ldmrtp";
this._LOAD_MORE_TOP_LINK="ldmrtplnk";this._LOAD_MORE_BOTTOM_DIV="ldmrbttm";this._LOAD_MORE_BOTTOM_LINK="ldmrbttmlnk";this._LOAD_INDEX_ATTR="data-afrldIndx";this._LOAD_MORE_RNG_TOP_TEXT="ldmrrngtptxt";this._LOAD_MORE_RNG_BOTTOM_TEXT="ldmrrngbttmtxt";this._SCROLLER_ANIMATION_CLASS="af|table::scroll-container";this._HIDDEN_WIDTH_DOM_WHEN_STRETCHED_ID="_afrHwdwsId"};
AdfDhtmlTableBasePeer.prototype.InitDomElement=function(a,b){var d=AdfPage.PAGE,e=AdfAgent.AGENT;AdfDhtmlTableBasePeer.superclass.InitDomElement.call(this,a,b);AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlTableBasePeer,b,AdfDhtmlLookAndFeel.MOUSE_MOVE_EVENT_TYPE);AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlTableBasePeer,b,AdfDhtmlLookAndFeel.KEY_DOWN_EVENT_TYPE);this._autoHeightRows=e.getIntAttribute(b,AdfDhtmlTableBasePeer._AUTO_HEIGHT_ROWS,0);var f=this.GetDataBody(b);this._colCount=
f?e.getIntAttribute(f,AdfDhtmlTableBasePeer._COL_COUNT,0):0;this._colSelEventSelectedColIds={};this._colSelEventUnselectedColIds={};this._supportsFocusRowNavigation=this.SupportsFocusRowNavigation(a);this._contextMenuSelect=a.getContextMenuSelect();a.getColumnResizing&&"enabled"!=a.getColumnResizing()||(this._colResizeDragCallback=this.createCallback(this._handleColResizeDrag),this._colResizeDropCallback=this.createCallback(this._handleColResizeDrop));a.getColumnStretching&&(this._columnStretching=
f=a.getColumnStretching(),"blank"==f?this._stretchedColumnId="_afrBlankColumn":0==f.indexOf("column:")&&(this._stretchedColumnId=f.substring(7)));this._editableTableReadOnlyMode=!1;this._hoverHighlightRow=this._isRowSelectionEnabled(a)&&"false"!=d.getLookAndFeel().getSkinProperty("af|table-tr-hover-highlight-row");this._singleSortIcon="true"==d.getLookAndFeel().getSkinProperty("af|table-tr-single-sort-icon");this._activeDataCount=-1;this._fetchId=0;this._lastColWidth=this._lastColWidthOverride=this._unavailableRowIndex=
-1;this._associatedId=a.getProperty("_afrMasterId");null==this._associatedId&&(this._associatedId=a.getProperty("_afrSlaveId"));this._focusManager={};this._streamingDisabled=d.isStreamingDisabled();this._isTouch=e.isTouchFirstDevice();this._maxCachedRowsForTouch=null!=a.getProperty(AdfDhtmlTableBasePeer._MAX_CACHED_ROWS_FOR_TOUCH)?a.getProperty(AdfDhtmlTableBasePeer._MAX_CACHED_ROWS_FOR_TOUCH):AdfDhtmlTableBasePeer._DEFAULT_MAX_CACHED_ROWS_FOR_TOUCH;e.getOS()==AdfAgent.MAC_OS?this._scrollbarBehavior=
null:this._scrollbarBehavior=a.getProperty(AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR);this._hShiftLoadMoreDataBody=this._hShiftDataBody="0px";this._insertDeleteAnimationInEffect=!1;d=a.getProperty("scrollPolicy");"loadMore"==d?this._isLoadMore=!0:"scrollPrefetch"==d&&(this._isScrollPrefetch=!0);if(this._isImplicitLoadMore=a.getProperty(AdfDhtmlTableBasePeer._IMPLICIT_LOAD_MORE))this._isLoadMore=!0;this._disableRowMouseDownCellFocus=a.getProperty("_disableRowMouseDownCellFocus");this._isSyncRows=a.getProperty("_afrSyncRows");
this._twinkledCells=[];this._twinkledCellAnnouncements="";this._avoidSettingFocusOnColumnHeader=!1;AdfPage.PAGE.__registerDescendantResizeNotifyComponent(a)};AdfDhtmlTableBasePeer.prototype.isDragAvailable=function(a){AdfAssert.assertDomElement(a);if(a){var b=this._isTargetCellEditable(a),d=null!=this._getTargetRowHeader(a);a=this._isTargetTextOnlyNode(a);if(d||b||a)return!1}return!0};
AdfDhtmlTableBasePeer.prototype.TruncateClientId=function(a,b,d,e){b=d.split(":");a=a.getClientId();a=AdfStrings.count(a,":")+1;(b=b[a])&&(isNaN(b)||e.push(a))};
AdfDhtmlTableBasePeer.prototype.ComponentRemoved=function(a){this._touchMoveManager&&this._touchMoveManager.unregister();if(this._handleTouchEndCallback){var b=AdfAgent.AGENT,d=this.GetDataBody();d&&b.removeBubbleEventListener(d,"touchend",this._handleTouchEndCallback);(d=this.__getColumnHeader())&&b.removeBubbleEventListener(d,"touchend",this._handleTouchEndCallback)}AdfPage.PAGE.__unregisterDescendantResizeNotifyComponent(a);AdfDhtmlTableBasePeer.superclass.ComponentRemoved.call(this,a)};
AdfDhtmlTableBasePeer.prototype.needsChildVisibilityChanges=function(a){return!0};AdfDhtmlTableBasePeer.prototype.ChildVisibilityChanged=function(a,b,d){AdfPage.PAGE.addPartialTargets(this.getComponent());return!0};AdfDhtmlTableBasePeer.prototype.SupportsFocusRowNavigation=function(){return!0};AdfDhtmlTableBasePeer.prototype.AllowCellNavigation=function(){return 0<this.getDomElement().id.indexOf("_afrDropDownContent")?!1:!0};AdfDhtmlTableBasePeer.prototype.needsResizeNotify=function(a){return!0};
AdfDhtmlTableBasePeer.prototype.GetPanelCollectionPeer=function(a){!this._pcPeer&&(a=null,a=this.getDomElement().getAttribute(AdfDhtmlTableBasePeer._PANEL_COLLECTION_ID),null!=a&&(a=AdfPage.PAGE.findComponent(a)))&&(this._pcPeer=a.getPeer());return this._pcPeer};AdfDhtmlTableBasePeer.prototype.GetPanelCollectionComponent=function(){if(!this._pcComponent){var a=this.getDomElement().getAttribute(AdfDhtmlTableBasePeer._PANEL_COLLECTION_ID);null!=a&&(this._pcComponent=AdfPage.PAGE.findComponent(a))}return this._pcComponent};
AdfDhtmlTableBasePeer.prototype._allRowsAvailableOnClient=function(a,b){var d=!1;if(0<b)var d=a[0],e=a[b-1],e=e.startRow+e.numRows,f=this.GetRowCount(),d=0<f&&0==d.startRow&&e==f;return d};AdfDhtmlTableBasePeer.prototype._updateScrollDivHeight=function(a){if(a){a=a.childNodes;var b=a.length;1===b&&this._allRowsAvailableOnClient(a,b)&&(a=a[0].offsetHeight,a>this._canvasHeight&&(this._canvasHeight=a,this._setFakeCanvasHeight(a)))}};
AdfDhtmlTableBasePeer._isInsideDialog=function(a){return a?a instanceof AdfRichDialog?!0:AdfDhtmlTableBasePeer._isInsideDialog(a.getParent()):!1};
AdfDhtmlTableBasePeer.prototype._isStretchedToContentInDialog=function(a,b,d){if(d&&(void 0===this._isInsideDialog&&window.AdfRichDialog&&(this._isInsideDialog=AdfDhtmlTableBasePeer._isInsideDialog(a)),this._isInsideDialog)){a=this._getScrollWidth();if(void 0===a)return b.clientWidth>=b.scrollWidth;b=this.__getColumnHeader();var e;b&&(e=b.offsetWidth);return Math.max(e,d.offsetWidth)>=a}};
AdfDhtmlTableBasePeer.prototype.ResizeNotify=function(a,b,d,e){if(this.BusyAnimating()){var f=this;this.delayedResizeNotify=function(){f.ResizeNotify(a,b,d,e)}}else{delete this._cachedFirstVisibleRowKeyAndRow;var g=AdfAgent.AGENT,h=this.getComponent(),k=h.getClientId(),l=this.GetDataBody();if(g=g.getElementById(AdfRichUIPeer.CreateSubId(k,AdfDhtmlTableBasePeer._HIDDEN_WIDTH_DOM_WHEN_STRETCHED_ID))){if(b==e&&this._isStretchedToContentInDialog(h,this.getDomElement(),l))return;g.style.width=d+"px"}if(this._virtInitialized)g=
AdfAgent.AGENT,this.isHeightAutoSized()?this.AdjustAutoHeight():(this._updateScrollDivHeight(l),this._setScrollerHeight(e,this._cachedCHHeight,this._cachedCFHeight,this._cachedNBHeight)),this._setScrollerWidth(d,this._frozenWidth),this.SizeDataBody(l,d,e),h=this.__getScrollLeft(),g=this._getScrollTop(),this._currentScrollTop==g&&this._currentScrollLeft==h||this.scrollToPos(this._currentScrollLeft,this._currentScrollTop),this._stretchTheColumns(),this._syncDataBodyHeights(),!this._isPaged&&!this._isLoadMore&&
-1==this._rowCount&&this._canvasHeight<e-this._cachedCHHeight-this._cachedCFHeight&&(this._canvasHeight=e-this._cachedCHHeight-this._cachedCFHeight+AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE,this._setFakeCanvasHeight(this._canvasHeight)),this._fillViewPort(l,l.offsetHeight,!1);else if(this._isImmediateContentDelivery(this.getComponent())||this._isInlineDataAvailable(this.getComponent())){h=null;if(l)for(this._unavailableRowIndex=this._getUnavailableRowIndex(l),l=l.childNodes,g=l.length-1;0<=g;g--)if("TABLE"==
l[g].tagName){h=l[g];break}this._fixOuterHeight();this._initColumnHeader();this._initColumnFooter();this._initNavBar();this._initLoadMore();null!=h&&0<h.rows.length?(this._initVirtualization(h,!0),this._processClickToEditRequestTimerId=AdfPage.PAGE.scheduleTimer(this,this._processClickToEditRequest,!1,10)):(this.IsEmpty=!0,this.getDomElement().style.overflow="auto",this.AdjustAutoHeight(),this._updatePCState());if(this.IsEmpty){if(l=this.__getColumnHeader())h=this.getDomElement(),l.style.border="0px",
g=l.offsetWidth,g<=h.clientWidth&&(h.style.overflow="hidden");if(g=this._getColumnFooter())h=this.getDomElement(),g.style.border="0px",g.offsetWidth<=h.clientWidth&&(h.style.overflow="hidden");(l||g)&&this.AdjustAutoHeight()}this._stretchTheColumns();this._checkLoadMore()}else if(this._firstBlockRequested)!this._headerless&&this.IsEmpty&&this._stretchTheColumns(),this.IsEmpty&&0<this._autoHeightRows&&(!this._hasSingleScroller()||this._isPaged||this._isLoadMore)&&this.AdjustAutoHeight();else if(g=
AdfAgent.getAgent(),l=this.getDomElement(),this.IsEmpty=l=g.getAttribute(l,"_afrEmpty",!1),l||(this._firstBlockRequested=!0,h=this.getComponent(),!this._streamingDisabled&&AdfPage.PAGE.isStreamingRequestPending(h.getClientId())||this._queueFetchEvent(!0,AdfTableDataFetchEvent.INITIAL_SUBTYPE,-1),AdfDhtmlTableBasePeer.SetCursor(this.GetDataBody(),"wait")),this._initColumnHeader(),this._initColumnFooter(),this._initNavBar(),this._initLoadMore(),l||(h=AdfPage.PAGE.getLookAndFeel().getTranslatedString("af_table.LABEL_FETCHING"),
this.DisplayStatus(h,!0)),l){this.getDomElement().style.overflow="auto";this._stretchTheColumns();if(l=this.__getColumnHeader())h=this.getDomElement(),l.style.border="0px",g=l.offsetWidth,g<=h.clientWidth&&(h.style.overflow="hidden");this._updatePCState()}this._hasNavBar&&this._resizeNavBar(d,e);this._anchorRowKey||(this._anchorRowKey=this.GetLastRowKey())}};
AdfDhtmlTableBasePeer.prototype._initColumnHeader=function(){var a=AdfAgent.getAgent(),b=a.getIntAttribute(this.getDomElement(),"_lastFrozen",-1),a=a.getIntAttribute(this.getDomElement(),"_firstFrozen",-1);this._lastFrozen=b;this._firstFrozen=a;if(b=this.__getColumnHeader()){if(0<this._autoHeightRows&&this._hasFrozenColumn()&&!this._columnHeaderUnwrapped){var d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(b,"TABLE"),e=d.rows[0],f=a=null;this._freezeColumnsToEnd()?(a=AdfDhtmlTableBasePeer.FindFirstChildByTagName(e.cells[1],
"TABLE"),f=AdfDhtmlTableBasePeer.FindFirstChildByTagName(e.cells[0],"DIV")):(a=AdfDhtmlTableBasePeer.FindFirstChildByTagName(e.cells[0],"TABLE"),f=AdfDhtmlTableBasePeer.FindFirstChildByTagName(e.cells[1],"DIV"));a.parentNode.removeChild(a);f.parentNode.removeChild(f);b.removeChild(d);this._freezeColumnsToEnd()?f.style.cssText="overflow:hidden;position:absolute;top:0px;":(d=a.style.width,e="left:",AdfDhtmlTableBasePeer._isRTL()&&(e="right:"),f.style.cssText="overflow:hidden;position:absolute;top:0px;"+
e+d);this._freezeColumnsToEnd()?(b.appendChild(f),b.appendChild(a)):(b.appendChild(a),b.appendChild(f));this._columnHeaderUnwrapped=!0}this._synchronizeColumnRowHeights(b,"t","d2","t2");this._cachedCHHeight=b.offsetHeight;AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&8>AdfAgent.AGENT.getVersion()&&((d=AdfDhtmlTableBasePeer.__getChildBySubId(b,"t"))&&d.rows.length&&(d.rows[0].style.position="absolute"),b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"d2"))&&((d=AdfDhtmlTableBasePeer.__getChildBySubId(b,
"t2"))&&d.rows.length&&(d.rows[0].style.position="absolute"),AdfDhtmlTableBasePeer._isRTL()&&(d.style.right="0px"))}else this._headerless=!0,this._cachedCHHeight=0};AdfDhtmlTableBasePeer.prototype._hasFrozenColumn=function(){return 0<=this._lastFrozen||0<=this._firstFrozen};AdfDhtmlTableBasePeer.prototype._freezeColumnsToStart=function(){return 0<=this._lastFrozen};AdfDhtmlTableBasePeer.prototype._freezeColumnsToEnd=function(){return 0<=this._firstFrozen};
AdfDhtmlTableBasePeer.prototype._areAllColumnsFrozen=function(a){return 0<=this._lastFrozen&&a==this._lastFrozen+1||0==this._firstFrozen};AdfDhtmlTableBasePeer.prototype._isColumnFrozen=function(a){return 0<=this._lastFrozen&&a<=this._lastFrozen||0<=this._firstFrozen&&a>=this._firstFrozen};AdfDhtmlTableBasePeer.prototype._hasSingleScroller=function(){return this._footerless&&!this._freezeColumnsToEnd()};
AdfDhtmlTableBasePeer.prototype._initColumnFooter=function(){var a=this._getColumnFooter();a?(this._synchronizeColumnRowHeights(a,"ft","fd2","ft2"),this._cachedCFHeight=a.offsetHeight):(this._footerless=!0,this._cachedCFHeight=0)};
AdfDhtmlTableBasePeer.prototype._initNavBar=function(){var a=this._getNavigationBar();if(a){this._hasNavBar=!0;setTimeout(function(){var a=AdfPage.PAGE.getActiveDomElement(),b=AdfPage.PAGE.getLookAndFeel().getSkinProperty("af|table::navbar-page-link");null!=a&&a.className==b&&a.blur()},0);this._cachedNBHeight=a.offsetHeight;var b=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(this.getComponent().getClientId(),"nb_cnt"));this._cachedNBWidth=b.offsetWidth;this._isPaged=!0;this.RegisterFirstPropertyChange();
if(null!=this.getComponent().getProperty("_afrSlaveId")||null!=this.getComponent().getProperty("_afrMasterId"))a.firstChild.style.display="none",a.style.height=0,this._cachedNBHeight=a.offsetHeight,this._cachedNBWidth=b.offsetWidth}else this._cachedNBWidth=this._cachedNBHeight=0;this._nbarMin=!1};
AdfDhtmlTableBasePeer.prototype._initLoadMore=function(){var a=this._getLoadMore(!1),b=this._getLoadMore(!0);a?(this._cachedFMHeight=a.offsetHeight,this._cachedFMWidth=a.offsetWidth,a.style.display="none",a.style.overflow="hidden",a.style.zIndex=1,a.style.visibility="visible",b.style.display="none",b.style.overflow="hidden",b.style.zIndex=1,b.style.visibility="visible",a=this.__getColumnHeader(),null!=a&&(a.style.zIndex=2)):this._cachedFMWidth=this._cachedFMHeight=0};
AdfDhtmlTableBasePeer.prototype.__fixPanelCollectionDimensions=function(a){if(this._autoHeightRows){var b=this.getDomElement(),d=this.GetPanelCollectionPeer(),e=d.getDomElement(),f=d.getDomElement(),g=this.GetPanelCollectionComponent(),h=AdfAgent.getAgent(),k=h.getPlatform()==AdfAgent.WEBKIT_PLATFORM;if(d&&g){var l=g.getClientId(),g=h.getElementById(AdfRichUIPeer.CreateSubId(l,d.__getAutoHeightTopFacetId())),l=h.getElementById(AdfRichUIPeer.CreateSubId(l,d.__getAutoHeightBottomFacetId())),g=g?g.offsetHeight:
0,l=l?l.offsetHeight:0;if(d.isDetached()){e=b.parentNode.parentNode;d=b.style;if(!a&&null==f.getAttribute("_afrPreDetachW")){a=d.width;var d=this.GetDataBody(),m=d.offsetHeight+this._getScrollbarHeight(),m=m+"px";""===a&&(a=d.offsetWidth+this._getScrollbarWidth(),a+="px");f.setAttribute("_afrPreDetachW",a);f.setAttribute("_afrPreDetachH",m)}k?(f=h.getComputedStyle(b),b.style.width=e.clientWidth-parseInt(f.borderLeftWidth)-parseInt(f.borderRightWidth)+"px"):h.setOuterWidth(b,e.clientWidth);h.setOuterHeight(b,
e.clientHeight-g-l)}else h=f.getAttribute("_afrPreDetachH"),void 0!=h&&(b.style.height=h,f.removeAttribute("_afrPreDetachH")),h=f.getAttribute("_afrPreDetachW"),void 0!=h&&(b.style.width=a?"":h,f.removeAttribute("_afrPreDetachW")),this._sizeOuterContainer(e,b.offsetHeight+g+l)}}};AdfDhtmlTableBasePeer.prototype._isContainerStretched=function(){var a=this.getDomElement().style;return"absolute"==a.position&&a.top&&0<a.top.length&&a.bottom&&0<a.bottom.length};
AdfDhtmlTableBasePeer.prototype._isPCContainerStretched=function(){var a=!1;this.getDomElement();var b=this.GetPanelCollectionPeer();b&&(a=b.getDomElement().style,a="absolute"==a.position&&a.top&&0<a.top.length&&a.bottom&&0<a.bottom.length);return a};AdfDhtmlTableBasePeer.prototype.isHeightAutoSized=function(){return 0<this._autoHeightRows};
AdfDhtmlTableBasePeer.prototype._fixOuterHeight=function(){var a=!1;if(0<this._autoHeightRows){var b=AdfAgent.AGENT,d=this.getDomElement(),e=d.style;"auto"!=e.height||this._isContainerStretched()||(b.getPlatform()==AdfAgent.IE_PLATFORM&&8>b.getVersion()&&d.scrollWidth<=d.offsetWidth&&(e.height=d.clientHeight+"px",a=!0),a||(b.setOuterHeight(d,d.offsetHeight),a=!0));e.overflowX="";e.overflowY=""}return a};AdfDhtmlTableBasePeer.prototype.BeginHandleDataBlocks=function(){};
AdfDhtmlTableBasePeer.prototype.ReplaceDomElement=function(a,b){var d=a.id;if(0<d.indexOf(AdfDhtmlTableBasePeer.DW_SUB_ID)){var d=AdfAgent.AGENT,e=this.GetDataBody();this.BeginHandleDataBlocks();var f=AdfDhtmlTableBasePeer._findFirstLevelChildrenByTagName(a,"TABLE");this._unavailableRowIndex=this._getUnavailableRowIndex(a);var g=!1;if(this._virtInitialized){0==f.length&&(g=!0);var h=d.getIntAttribute(a,"_fetchId",-1),k=this._pendingFetch;if(void 0!=k&&this._pendingId==h){h=this._pendingRenderOnly;
this.CancelPendingFetch();this._cleanUpDataFetchElement(b);if(d.getBooleanAttribute(a,AdfDhtmlTableBasePeer.NEEDS_REFRESH_ATTRIBUTE,!1)){AdfPage.PAGE.addPartialTargets(this.getComponent());return}if(d.getBooleanAttribute(a,AdfDhtmlTableBasePeer.UNDO_FETCH_ATTRIBUTE,!1)){k==AdfTableDataFetchEvent.FROM_INDEX_SUBTYPE||k==AdfTableDataFetchEvent.UP_TO_INDEX_SUBTYPE||k==AdfTableDataFetchEvent.AFTER_KEY_SUBTYPE||k==AdfTableDataFetchEvent.BEFORE_KEY_SUBTYPE?this._undoScroll():k==AdfTableDataFetchEvent.EXPAND_SUBTYPE||
k==AdfTableDataFetchEvent.COLLAPSE_SUBTYPE?this._restoreSavedDisclosureState():k==AdfTableDataFetchEvent.CLICK_EDIT_ACTIVE_ROW&&this._restoreActiveRowKey();AdfDhtmlTableBasePeer.SetCursor(e,"");this._hideStatus();this.getComponent().setProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY,!1,!1,AdfUIComponent.PROPAGATE_ALWAYS);return}delete this._cachedFirstVisibleRowKeyAndRow;this._savedDisclosedState=void 0;for(var l=0;l<f.length;l++){a.removeChild(f[l]);this._pruneKeyCache||(this._pruneKeyCache=d.getAttribute(f[l],
"_pruneKeyCache",null));var m=d.getIntAttribute(f[l],"_adsCounter",-1),n=!1;0==l&&this._applyBufferedADSEvents(m,!0);n=this._handleDataCallback(f[l],k,h,f.length-l-1);l==f.length-1&&(this._applyBufferedADSEvents(m,!1),this._resetActiveMessageBuffer(),this._activeDataCount<m&&(this._activeDataCount=m));n||this._addInvalidDataBlockToFetchElement(b,f[l]);d.elementsAdded(f[l])}this._fillViewPort(e,e.offsetHeight,!1);this.FetchCompleted()}else if(h==AdfDhtmlTableBasePeer.AUTO_PPR_FETCH_ID&&void 0==k){if(!this._handleAutoPPRDataFetch(a,
f,e,g))return}else this._handleIrrelaventFetchBlocks(a,b,f)}else this._firstBlockRequested||(this._initColumnHeader(),this._initColumnFooter(),this._initNavBar(),this._initLoadMore(),this._firstBlockRequested=!0),this.CancelPendingFetch(),0<f.length&&0<f[0].rows.length?(this._initVirtualization(f[0],!1),d.elementsAdded(f[0]),this._processClickToEditRequestTimerId=AdfPage.PAGE.scheduleTimer(this,this._processClickToEditRequest,!1,10),this.AdjustAutoHeight()):g=!0;g?this._hasRefreshAutoPPRBlock(f)?
AdfPage.PAGE.addPartialTargets(this.getComponent()):(this._handleEmptyTextBlock(a,e),this.AdjustAutoHeight()):(this._editableTableReadOnlyMode&&this._disableTabStop(!0),(d=this._getActiveCellNode())?(e=AdfAgent.AGENT.getScrollLeft(d))&&e==this._currentScrollLeft&&this._setFocusOnNode(d):this._restoreActiveCellFromDom())}else if(0<d.indexOf("nbar")){if(d=this._getNavigationBar())d.parentNode.replaceChild(a,d),AdfAgent.AGENT.elementsAdded(a)}else e=(d=AdfDhtmlTableBasePeer._findHiddenLabel(b))?d.textContent:
null,AdfDhtmlTableBasePeer.superclass.ReplaceDomElement.call(this,a,b),e&&(d=AdfDhtmlTableBasePeer._findHiddenLabel(a))&&this._matchLabelEnds(e,d.textContent)&&(d.textContent=e)};AdfDhtmlTableBasePeer.prototype._matchLabelEnds=function(a,b){if(!b)return!0;var d=a.length,e=b.length,f;if(d<e)return!1;for(f=0;f<e&&a.charAt(f)==b.charAt(f);f++);return b.substr(f)==a.substr(d-(e-f))};
AdfDhtmlTableBasePeer.prototype._handleAutoPPRDataFetch=function(a,b,d,e){var f=this._hasRefreshAutoPPRBlock(b),g=AdfAgent.AGENT;if(f)return AdfPage.PAGE.addPartialTargets(this.getComponent()),!1;if(!e){e=!1;for(var f=(f=AdfPage.PAGE.getActiveDomElement())?f.id:null,h=0;h<b.length;h++){a.removeChild(b[h]);this._pruneKeyCache||(this._pruneKeyCache=g.getAttribute(b[h],"_pruneKeyCache",null));var k=g.getIntAttribute(b[h],"_autopprBlock",-1);this._updateComponentDisclosureState(b[h]);this._updateComponentSelectionState(b[h]);
this._updateAutoPPRActiveRowKey(b[h]);this.AutoPPRBlockReceived(b[h]);switch(k){case AdfDhtmlTableBasePeer.AUTO_PPR_INSERT_BEFORE_BLOCK:case AdfDhtmlTableBasePeer.AUTO_PPR_INSERT_AFTER_BLOCK:var l=g.getIntAttribute(b[h],"insertPath",null),m=this.FindRowByKey(l);if(m){var n=b[h].rows.length,q=null;0<n&&(l=b[h].rows[0],q=l.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY));q&&!this.FindRowByKey(q)&&(l=m.index,void 0!=l&&this.IsInsertAllowed(l)&&(k==AdfDhtmlTableBasePeer.AUTO_PPR_INSERT_AFTER_BLOCK&&l++,
g.elementsAdded(b[h]),k=AdfDhtmlTableBasePeer._getBlockRowCount(b[h]),q=AdfAgent.AGENT.getIntAttribute(b[h],"totalInserted",0),this.InsertBlock(b[h],l,k,q,0),this.UpdateRange(!1)))}break;case AdfDhtmlTableBasePeer.AUTO_PPR_REMOVE_BLOCK:e=this.HandleAutoPPRRemove(b[h]);break;case AdfDhtmlTableBasePeer.AUTO_PPR_UPDATE_BLOCK:n=b[h].rows.length,0<n&&(l=b[h].rows[0],q=l.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),k=1<n&&this._hasDetailStamp?b[h].rows[1]:null,this._replaceRowByKey(q,l,k),f&&(q=g.getElementById(f))&&
(AdfDomUtils.isAncestor(l,q)||k&&AdfDomUtils.isAncestor(k,q))&&AdfFocusUtils.focusElement(q))}}this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT,!0);this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE,!0);a=this._currentScrollLeft;0!=a&&this._handleHorizontalScroll(a);e&&this._fillViewPort(d,d.offsetHeight,!1)}return!0};
AdfDhtmlTableBasePeer.prototype._handleEmptyTextBlock=function(a,b){if(this._virtInitialized)AdfLogger.LOGGER.severe("Empty data block received:"+id);else{for(var d=a.childNodes,e=d.length,f=0;f<e;f++){var g=d[0];a.removeChild(g);b.appendChild(g)}this._updatePCState();this._hideStatus();this.getDomElement().style.overflow="auto";this.IsEmpty=!0;this._stretchTheColumns();if(d=this.__getColumnHeader())d.style.border="0px",e=this.getDomElement(),d.offsetWidth<=e.clientWidth&&(e.style.overflow="hidden");
AdfDhtmlTableBasePeer.SetCursor(b,"")}};AdfDhtmlTableBasePeer.prototype._handleIrrelaventFetchBlocks=function(a,b,d){var e=AdfAgent.AGENT;this._cleanUpDataFetchElement(b);for(var f=0;f<d.length;f++)a.removeChild(d[f]),this._addInvalidDataBlockToFetchElement(b,d[f]),e.elementsAdded(d[f])};
AdfDhtmlTableBasePeer.prototype._addInvalidDataBlockToFetchElement=function(a,b){for(var d=b.rows,e=d.length,f=null,g=0;g<e;g++){var h=d[g],k=h.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY);null!=k&&null!=this.FindRowByKey(k)&&(f||(f=[]),f.push(h))}if(null!=f)for(e=f.length,g=0;g<e;g++)f[g].parentNode.removeChild(f[g]);a.appendChild(b)};AdfDhtmlTableBasePeer.prototype._cleanUpDataFetchElement=function(a){for(;null!=a.firstChild;){var b=a.firstChild;this._unregisterNode(b);a.removeChild(b)}};
AdfDhtmlTableBasePeer.prototype._hasRefreshAutoPPRBlock=function(a){for(var b=AdfAgent.AGENT,d=0;d<a.length;d++)if(b.getBooleanAttribute(a[d],AdfDhtmlTableBasePeer.NEEDS_REFRESH_ATTRIBUTE,!1))return!0;return!1};AdfDhtmlTableBasePeer.prototype.AutoPPRBlockReceived=function(a){};AdfDhtmlTableBasePeer.prototype.HandleAutoPPRRemove=function(a){var b=!1;if(a=AdfAgent.AGENT.getAttribute(a,"_parentKey",null))if(a=this.FindRowByKey(a))this.DeleteBlock(a.index,1,1,0,null),this.UpdateRange(!1),b=!0;return b};
AdfDhtmlTableBasePeer.prototype.DomReplaceNotify=function(a){return 0<a.id.indexOf(AdfDhtmlTableBasePeer.DW_SUB_ID)?null:a};AdfDhtmlTableBasePeer.prototype._getUnavailableRowIndex=function(a){var b=-1,d=AdfAgent.AGENT;if(a){var e=AdfDhtmlTableBasePeer.__getChildBySubId(a,"unAvail");e&&(b=d.getIntAttribute(e,"_unavailableRowIndex",-1),a.removeChild(e))}return b};
AdfDhtmlTableBasePeer.prototype._queueExpandFetchEvent=function(){var a=this._queueFetchEvent(!1,AdfTableDataFetchEvent.EXPAND_SUBTYPE);AdfDhtmlTableBasePeer.SetCursor(this.GetDataBody(),"wait");this._pruneKeyCache&&(a.setClientTokens(this._collectClientTokens(this._pruneKeyCache)),this._pruneKeyCache=null)};AdfDhtmlTableBasePeer.prototype._queueCollapseFetchEvent=function(){this._queueFetchEvent(!1,AdfTableDataFetchEvent.COLLAPSE_SUBTYPE);AdfDhtmlTableBasePeer.SetCursor(this.GetDataBody(),"wait")};
AdfDhtmlTableBasePeer.prototype.BlockInserted=function(a,b,d){};AdfDhtmlTableBasePeer.prototype.BlockDeleted=function(){};
AdfDhtmlTableBasePeer.prototype.DeleteBlock=function(a,b,d,e,f){for(var g=this.GetDataBody(),h=g.childNodes,k=0,l=0,m=0,n=h.length-1;0<=n&&m<b;n--){var q=h[n],k=k+q.cachedHeight,r=Math.max(a,q.startRow),t=Math.min(a+b-1,q.startRow+q.numRows-1),u=0,v=0,w=null;if(r==q.startRow&&t==q.startRow+q.numRows-1)v=q.cachedHeight,w=q,u=q.numRows,f&&(f.push(q),f.totalHeight+=q.offsetHeight);else{for(;t>=r;t--){var y=t-q.startRow;if(0==y){AdfAssert.assert(null!=q.rows&&null!=q.rows[0],"Unable to copy cell widths when the block contains no rows!");
for(var z=q.rows[0].cells,B=q.rows[1].cells,C=0;C<B.length;C++)B[C].style.width=z[C].style.width}y=q.rows[y];f&&(f.push(y),f.totalHeight+=y.offsetHeight);this._unregisterNode(y);y.parentNode.removeChild(y);u++}0<u&&(r=q.offsetHeight,v=q.cachedHeight-r,q.cachedHeight=r,q.numRows=q.rows.length);l+=q.cachedHeight}if(0<u){for(q=n+1;q<h.length;q++)r=h[q],r.startPos-=v,r.startRow-=u;w&&(this._unregisterNode(w),g.removeChild(w))}m+=u}a=m==d?l-k:-this._averageRowHeight*d;this._knownRowCount-=d;-1!=this._rowCount&&
(this._rowCount-=d);0<this._knownRowCount&&(missing=this._isViewportSatisfied(g,g.offsetHeight),missing&AdfDhtmlTableBasePeer.MISSING_AFTER&&this._addBelow(g,g.offsetHeight,!1));this._adjustCanvasHeight(a,g);0==e&&(this._stretchTheColumns(),this._checkForScrollableLastBlockInViewport(g),this.BlockDeleted())};AdfDhtmlTableBasePeer.prototype.FetchCompleted=function(){this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE,!0,null)};
AdfDhtmlTableBasePeer.prototype.GetAssociatedComponent=function(){return null!=this._associatedPeer?this._associatedPeer.getComponent():null};AdfDhtmlTableBasePeer.prototype._updateInitialARK=function(a){var b=this.getComponent();if(a=a.getAttribute("_initARK")){this._ignoreActiveRowKeyChange=!0;try{b.setProperty("_afrActiveRowKey",a,!1,AdfUIComponent.PROPAGATE_NEVER),b.setProperty("activeRowKey",a,!1,AdfUIComponent.PROPAGATE_NEVER)}finally{this._ignoreActiveRowKeyChange=!1}}};
AdfDhtmlTableBasePeer.prototype._updateComponentSelectionState=function(a){var b=this.getComponent();if(a=a.getAttribute("_selState"))a=a.replace(/'/g,'"'),a=JSON.parse(a),b.setProperty("selectedRowKeys",a,!1,AdfUIComponent.PROPAGATE_NEVER),AdfPage.PAGE._getScriptLoadingService().addCallbackScript(this,this._setFocusOnSelectedRow)};
AdfDhtmlTableBasePeer.prototype._setFocusOnSelectedRow=function(){var a=AdfPage.PAGE.getActiveDomElement();if(a){var b=this.getDomElement(),d=this.getComponent().getSelectedRowKeys(),e;for(e in d)if(d[e]){var f=this.FindRowByKey(e);if(f&&(f=f.tr,a!=b&&this.isInActiveHeirarchy()&&!AdfDomUtils.isAncestorOrSelf(f,a))){this._setFocusOnNode(f,0);break}}}};
AdfDhtmlTableBasePeer.prototype._updateAutoPPRActiveRowKey=function(a){var b=this.getComponent();a=AdfAgent.AGENT.getAttribute(a,"_autopprActiveRow",null);if(null!=a){this._ignoreActiveRowKeyChange=!0;try{a=0==a.length?null:a,b.setProperty("_afrActiveRowKey",a,!1,AdfUIComponent.PROPAGATE_NEVER),b.setProperty("activeRowKey",a,!1,AdfUIComponent.PROPAGATE_NEVER),this._processClickToEditRequestTimerId=AdfPage.PAGE.scheduleTimer(this,this._processClickToEditRequest,!1,10)}finally{this._ignoreActiveRowKeyChange=
!1}}};AdfDhtmlTableBasePeer.prototype._updateComponentDisclosureState=function(a){var b=this.getComponent();if(a=a.getAttribute("_discState"))eval("var st\x3d"+a+";"),b.setProperty("disclosedRowKeys",st,!1,AdfUIComponent.PROPAGATE_NEVER)};
AdfDhtmlTableBasePeer.prototype._initVirtualization=function(a,b){try{this._hideStatus();this._virtInitialized=!0;var d=AdfAgent.AGENT,e=d.getIntAttribute(a,"_startRow",0),f=d.getIntAttribute(a,"_visibleRow",-1),g=AdfDhtmlTableBasePeer._getBlockRowCount(a),h=this.getComponent(),k=this.GetDataBody(),l=d.getIntAttribute(a,"_rowCount",-1),m=this._isPaged,n=this._isLoadMore,q=this._getEstimatedRowCount(a);0<=q&&(g=q,l=-1);0==this._unavailableRowIndex?l=-1:0<this._unavailableRowIndex&&(l=this._unavailableRowIndex);
var r=this._knownRowCount=this._rowCount=l,t=0;-1==r&&(r=e+g,this._knownRowCount=e+g);this._updateComponentSelectionState(a);this._updateInitialARK(a);var u=this.getDomElement();d.setScrollLeft(u,0);var v=u.clientWidth,w=u.clientHeight,y=d.getIntAttribute(a,"_frWidth",0);this._frozenWidth=y;var z=d.getIntAttribute(a,"_totalWidth",-1);this._totalWidth=z;this._unfrozenWidth=z-y;this._hasDetailStamp=d.getAttribute(a,AdfDhtmlTableBasePeer._HAS_DETAIL_MARKER,!1);if(!b){for(var B=k.childNodes,C=B.length-
1;0<=C;C--)k.removeChild(B[C]);k.appendChild(a);v=u.clientWidth;w=u.clientHeight}var A=a.offsetHeight,E=AdfDhtmlTableBasePeer._getBlockRowCount(a);a.cachedHeight=A;var F=Math.round(A/E);this._averageRowHeight=F;var D;D=!m&&!n&&r>g?F*r:-1==l&&!m&&!n&&A<w-this._cachedCHHeight-this._cachedCFHeight-this._cachedNBHeight?w-this._cachedCHHeight-this._cachedCFHeight-this._cachedNBHeight:A;-1!=l||m||n||(0<q&&(D+=F*q),D+=AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE);a.style.position="relative";k.scrollTop=
0;a.startRow=e;a.numRows=E;a.startPos=!m&&!n&&0<e?t=F*e:0;var J=this._createAndInitializeScroller(u,v,w,D,y,a);this._scrollbarBehavior!=AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_AUTOHIDE&&this._addScrollEventListeners(k);this._innerTableScrollCallback=this.createCallback(this._handleInnerTableScroll);this._registerInnerScrollCallback(a);if(!this._headerless){var G=this.__getColumnHeader();if(!this._hasFrozenColumn())G.onscroll=this._innerTableScrollCallback;else if(!this._areAllColumnsFrozen(this._colCount)){var H=
AdfDhtmlTableBasePeer.__getChildBySubId(G,"d2");H.onscroll=this._innerTableScrollCallback}}if(!this._footerless){var K=this._getColumnFooter();this._hasFrozenColumn()?this._areAllColumnsFrozen(this._colCount)||(H=AdfDhtmlTableBasePeer.__getChildBySubId(K,"fd2"),H.onscroll=this._innerTableScrollCallback):K.onscroll=this._innerTableScrollCallback}var L=this.SizeDataBody(k,v,w);k.style.zIndex=1;t=this._computeInitialScrollTop(h,a,e,D,L,A);this._initScrollLeftTop(J,t);!this.isHeightAutoSized()&&-1<f&&
this.scrollToRowIndex(f);this._restoreScrollPosition();this._synchronizeRowHeights(a);this.isHeightAutoSized()&&(this.AdjustAutoHeight(),this._currentScrollTop=t=this._computeInitialScrollTop(h,a,e,D,k.offsetHeight,A),0<t&&(this._hasSingleScroller()&&!m?J.scrollTop=t:J[0].scrollTop=J[1].scrollTop=t),-1<f&&this.scrollToRowIndex(f));this._stretchTheColumns();this._fillViewPort(k,k.offsetHeight,!1);this._syncDataBodyHeights();null==this._getActiveRowKey()&&this._setReadOnlyMode(!0,null,!1)}finally{this._updatePCState(),
this.UpdateRange(!0),this._virtInitializedComplete=!0}};AdfDhtmlTableBasePeer.prototype._computeInitialScrollTop=function(a,b,d,e,f,g){if(this._isPaged)return 0;var h=0;0<d&&(h=Math.min(b.startPos,e-f),h=Math.max(0,h));"last"==a.getDisplayRow()&&f<e&&(h=e-f,b.startPos=e-g);return h};AdfDhtmlTableBasePeer.prototype._handleTouchMovement=function(a,b){var d=this.__getScrollPos();d&&(scrollLeft=d.x-a,scrollTop=d.y-b,this._scrollerScrollToPos(scrollLeft,scrollTop))};
AdfDhtmlTableBasePeer.prototype._syncDataBodyHeights=function(){var a=this.getComponent(),b=a.getProperty("_afrMasterId"),d=a.getProperty("_afrSlaveId");(b||d)&&this._hasSingleScroller()&&AdfPage.PAGE.scheduleTimer(this,this._syncDataBodyHeightsTimeout,a,0)};
AdfDhtmlTableBasePeer.prototype._syncDataBodyHeightsTimeout=function(a){a=a.getParent().findComponent(this._associatedId);AdfAssert.assert(null!=a,"There is no associated table");var b=a.getPeer();a=this.GetDataBody();var d=b.GetDataBody(),e=this.GetScroller(),b=b.GetScroller();if(e&&b){var f=e.firstChild,g=b.firstChild;if(f&&g){var h=("auto"==e.style.overflowX||"auto"==e.style.overflow)&&e.offsetHeight>e.clientHeight,k=("auto"==b.style.overflowX||"auto"==b.style.overflow)&&b.offsetHeight>b.clientHeight,
l=parseInt(a.style.height),m=parseInt(d.style.height);isNaN(l)||isNaN(m)||(k&&!h?(a.style.height=m+"px",e.style.height=b.style.height,e.style.overflowX="scroll",f.style.height=g.style.height):h&&!k?(d.style.height=l+"px",b.style.height=e.style.height,b.style.overflowX="scroll",g.style.height=f.style.height):"auto"==b.style.overflowX?(e.style.overflowX="auto",a.style.height=m+"px",e.style.height=b.style.height,f.style.height=g.style.height):(b.style.overflowX="auto",d.style.height=l+"px",b.style.height=
e.style.height,g.style.height=f.style.height))}}};
AdfDhtmlTableBasePeer.prototype._createAndInitializeScroller=function(a,b,d,e,f,g){var h=AdfAgent.AGENT,k;if(!this._hasSingleScroller()||this._isPaged||this._freezeColumnsToEnd())k=this._createAndInitializeColumnFooterScroller(a,b,d,e,f,g);else{var l=this.getDomDocument();k=l.createElement("div");k.tabIndex=-1;k.id=a.id+"::scroller";var m=k.style;m.position="absolute";this._isTouch&&h.getPlatform()==AdfAgent.WEBKIT_PLATFORM&&(m.setProperty("-webkit-overflow-scrolling","touch"),m.setProperty("-webkit-transform",
"translateZ(0px)"),h.getOS()==AdfAgent.MAC_OS&&AdfDomUtils.addCSSClassName(k,AdfPage.PAGE.getLookAndFeel().getStyleClass(AdfDhtmlTableBasePeer._SCROLLER_ANIMATION_CLASS)));if(null!=this._associatedId){var n=this.getComponent();null!=n.getProperty("_afrSlaveId")?(m.overflowX="auto",m.overflowY="hidden"):m.overflow="auto";n=n.getParent().findComponent(this._associatedId);AdfAssert.assert(null!=n,"There is no associated table");this._associatedPeer=n.getPeer();n=n.getPeer();null!=n&&n._associatedPeer!=
this&&(n._associatedPeer=this)}else this._freezeColumnsToEnd()?(m.overflowX="auto",m.overflowY="hidden"):m.overflow="auto";m.zIndex=0;m.width=Math.max(b-f,0)+"px";m.top=this._cachedCHHeight+"px";m.height=Math.max(d-this._cachedCHHeight,0)+"px";AdfDhtmlTableBasePeer._isRTL()?this._freezeColumnsToEnd()?m.right="0px":m.left="0px":this._freezeColumnsToEnd()?m.left="0px":m.right="0px";l=l.createElement("div");m=h.getIntAttribute(g,"_totalWidth",-1);-1==m&&(m=g.offsetWidth);l.style.width=m-f+"px";h.getPlatform()==
AdfAgent.IE_PLATFORM&&(l.style.position="absolute",0==m-f&&(l.style.width="1px"));this._canvasHeight=e;e>AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT?(l.style.height=AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT+"px",this._canvasHeightLimited=!0):(l.style.height=e+"px",this._canvasHeightLimited=!1);l.style.visibility="hidden";k.appendChild(l);a.appendChild(k);h.elementsAdded(k)}this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_AUTOHIDE&&(f=AdfPage.PAGE.getLookAndFeel(),e=this.GetDataBody(),
g=e.firstChild,l=f.getStyleClass(AdfDhtmlTableBasePeer._TABLE_H_LINES_CLASS),m=f.getStyleClass(AdfDhtmlTableBasePeer._TABLE_VH_LINES_CLASS),null!=g&&(AdfDomUtils.containsCSSClassName(g,l)||AdfDomUtils.containsCSSClassName(g,m))&&this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_AUTOHIDE&&AdfDomUtils.addCSSClassName(e,f.getStyleClass(AdfDhtmlTableBasePeer._SCROLLBAR_AUTOHIDE_DATABODY_H_LINES_CLASS)),g=this.getDomDocument().createElement("div"),g.setAttribute("id",AdfRichUIPeer.CreateSubId(a.id,
AdfDhtmlTableBasePeer._DATAWRAPPER)),f=f.getStyleClass(AdfDhtmlTableBasePeer._SCROLLBAR_AUTOHIDE_DATABODY_WRAPPER_CLASS),AdfDomUtils.addCSSClassName(g,f),f=g.style,this._cachedScrollerWidthAddl=a.offsetWidth-b,this._cachedScrollerHeightAddl=a.offsetHeight-d,f.height=a.offsetHeight-this._cachedCHHeight-this._cachedCFHeight+"px",f.width=a.offsetWidth+"px",f.overflowX="hidden",f.overflowY="hidden",f.position="relative",f.zIndex=1,this._addScrollEventListeners(g),a.insertBefore(g,e),this._isLoadMore?
(a=this._getLoadMore(!1),b=this._getLoadMore(!0),null!=b&&g.appendChild(b),g.appendChild(e),null!=a&&g.appendChild(a)):g.appendChild(e),h.elementsAdded(g),this._hasSingleScroller()&&!this._isPaged?(vscroller=this.GetScroller(),hscroller=this.GetScroller()):(vscroller=this.GetScroller()[AdfDhtmlTableBasePeer._VSCROLLER],hscroller=this.GetScroller()[AdfDhtmlTableBasePeer._HSCROLLER]),vscroller.style.visibility="hidden",hscroller.style.visibility="hidden",this._dataBodyWrapped=this._scrollbarHidden=
!0);return k};
AdfDhtmlTableBasePeer.prototype._initScrollLeftTop=function(a,b){this._currentScrollTop=b;this._hasSingleScroller()&&!this._isPaged?(0<b&&(a.scrollTop=b),this._currentScrollLeft=AdfDhtmlTableBasePeer._isRTL()?AdfAgent.AGENT.getScrollLeft(a):0,AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlTableBasePeer,a,AdfDhtmlLookAndFeel.SCROLL_EVENT_TYPE)):(0<b&&(a[0].scrollTop=a[1].scrollTop=b),this._currentScrollLeft=AdfDhtmlTableBasePeer._isRTL()?AdfAgent.AGENT.getScrollLeft(a[0]):0,AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlTableBasePeer,a[0],
AdfDhtmlLookAndFeel.SCROLL_EVENT_TYPE),AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlTableBasePeer,a[1],AdfDhtmlLookAndFeel.SCROLL_EVENT_TYPE))};
AdfDhtmlTableBasePeer.prototype._createAndInitializeColumnFooterScroller=function(a,b,d,e,f,g){var h=[],k=AdfAgent.AGENT,l=this.getDomDocument();hscroller=l.createElement("div");vscroller=l.createElement("div");hscroller.id=a.id+"::hscroller";vscroller.id=a.id+"::vscroller";hscroller.tabIndex=-1;vscroller.tabIndex=-1;var m=hscroller.style,n=vscroller.style;m.position=n.position="absolute";if(null!=this._associatedId){var q=this.getComponent();null!=q.getProperty("_afrSlaveId")?n.overflowY="hidden":
n.overflowY="auto";n.overflowX="hidden";m.overflowY="hidden";m.overflowX="auto";q=q.findComponent(this._associatedId);AdfAssert.assert(null!=q,"There is no associated table");this._associatedPeer=q.getPeer();q=q.getPeer();null!=q&&q._associatedPeer!=this&&(q._associatedPeer=this)}else n.overflowY="auto",n.overflowX="hidden",m.overflowY="hidden",m.overflowX="auto",this._isTouch&&k.getPlatform()==AdfAgent.WEBKIT_PLATFORM&&(n.setProperty("-webkit-overflow-scrolling","touch"),n.setProperty("-webkit-transform",
"translateZ(0px)"),m.setProperty("-webkit-overflow-scrolling","touch"),m.setProperty("-webkit-transform","translateZ(0px)"),k.getOS()==AdfAgent.MAC_OS&&(m.overflow="scroll",AdfPage.PAGE.getLookAndFeel().getStyleClass(AdfDhtmlTableBasePeer._SCROLLER_ANIMATION_CLASS),AdfDomUtils.addCSSClassName(vscroller,AdfDhtmlTableBasePeer.animationStyleClass),AdfDomUtils.addCSSClassName(hscroller,AdfDhtmlTableBasePeer.animationStyleClass)));m.zIndex=n.zIndex=0;n.width=Math.max(b-f,0)+"px";n.top=this._cachedCHHeight+
"px";n.height=Math.max(d-this._cachedCHHeight-this._cachedCFHeight-this._cachedNBHeight,0)+"px";AdfDhtmlTableBasePeer._isRTL()?(this._freezeColumnsToEnd()?m.right="0px":m.left="0px",n.left="0px"):(this._freezeColumnsToEnd()?m.left="0px":m.right="0px",n.right="0px");var q=l.createElement("div"),l=l.createElement("div"),r=k.getIntAttribute(g,"_totalWidth",-1);-1==r&&(r=g.offsetWidth);k.getPlatform()==AdfAgent.IE_PLATFORM&&(q.style.position=l.style.position="absolute");q.style.width=l.style.width=r-
f+"px";this._canvasHeight=e;q.style.height=l.style.height=e+"px";hscroller.appendChild(q);vscroller.appendChild(l);a.appendChild(vscroller);k.elementsAdded(vscroller);m.top=this._cachedCHHeight+"px";m.height=Math.max(d-this._cachedCHHeight,0)+"px";e=vscroller.offsetWidth-vscroller.clientWidth;AdfDhtmlTableBasePeer._isRTL()?m.left=e+"px":m.right=e+"px";m.width=Math.max(b-f-e,0)+"px";a.appendChild(hscroller);k.elementsAdded(hscroller);n.height=Math.max(d-this._cachedCHHeight-this._cachedCFHeight-this._cachedNBHeight-
(hscroller.offsetHeight-hscroller.clientHeight),0)+"px";h[AdfDhtmlTableBasePeer._HSCROLLER]=hscroller;h[AdfDhtmlTableBasePeer._VSCROLLER]=vscroller;return h};AdfDhtmlTableBasePeer.prototype._updatePCState=function(){var a=this.getDomElement().getAttribute(AdfDhtmlTableBasePeer._PANEL_COLLECTION_ID);null!=a&&(a=this._pcPeer=AdfPage.PAGE.findComponent(a).getPeer(),a.resetState(),a.updateStandardMenuToolbarItems(),a.updateStandardStatusbarItems(),a.updateRowSelectionContext())};
AdfDhtmlTableBasePeer.prototype.__getVisibleLeafColumns=function(){if(null!=this._visibleLeafColumns)return this._visibleLeafColumns;var a=this.getDomElement(),a=AdfAgent.AGENT.getAttribute(a,"_leafColClientIds");null!=a&&(a=a.replace(/'/g,'"'));var a=JSON.parse(a),b=[];if(null!=a)for(var d=a.length,e=0;e<d;e++){var f=AdfPage.PAGE.findComponent(a[e]);b.push(f)}return this._visibleLeafColumns=b};
AdfDhtmlTableBasePeer.__getSortOrderForColumn=function(a){var b=null;if(a=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(a,AdfDhtmlTableBasePeer.__SORT_INDICATOR)))a=a.getAttribute(AdfDhtmlTableBasePeer._SORTED_TYPE),a==AdfDhtmlTableBasePeer._SORTED_DESCENDING?b=!1:a==AdfDhtmlTableBasePeer._SORTED_ASCENDING&&(b=!0);return b};AdfDhtmlTableBasePeer.prototype.__getColumnResizeMargin=function(){AdfAssert.failedInAbstractFunction()};
AdfDhtmlTableBasePeer.prototype.HandleDomMouseMove=function(a,b){if(!this._headerless&&this._virtInitialized)if(this._resizedTH){var d=this._getParentTH(b);!d||a.getColumnResizing&&"enabled"!=a.getColumnResizing()||AdfDhtmlTableBasePeer.SetCursor(d,AdfAgent.AGENT.getCursor("col-resize"))}else if(d=this._mdPos){var e=AdfAgent.AGENT.getMousePosition(b);Math.abs(e.x-d.x)>this.__getColumnResizeMargin()&&(this._mdPos=null,this._processColumnReorderAction(b))}else if(this._reorderTH)AdfDhtmlTableBasePeer.SetCursor(this._reorderTH,
"move");else if(d=this.__getColumnHeaderMouseAction(b))e=d.cell,"resize"!=d.type||!this._getResizedCellInfo(d)||a.getColumnResizing&&"enabled"!=a.getColumnResizing()?"move"==d.type?AdfDhtmlTableBasePeer.SetCursor(e,AdfAgent.AGENT.getCursor("move")):"default"==d.type?AdfDhtmlTableBasePeer.SetCursor(e,"default"):AdfDhtmlTableBasePeer.SetCursor(e,""):AdfDhtmlTableBasePeer.SetCursor(e,AdfAgent.AGENT.getCursor("col-resize"))};
AdfDhtmlTableBasePeer.prototype.__handleColumnResizing=function(a,b){if(null==b&&(b=this.__getColumnHeaderMouseAction(a.getNativeEvent()),null==b))return;if("resize"==b.type){var d=this._getResizedCellInfo(b);d&&(this._resizedTH=d.cell,this._resizedIndex=d.displayIndex,this._showColumnResizeIndicator(d.cell,d.displayIndex),this._resizeColDelta=0,d=this.__getColumnHeader(),AdfAgent.AGENT.disableUserSelect(d),a.cancel(),d=a.getNativeEvent(),AdfPage.PAGE.startDrag(d,this._colResizeDragCallback,this._colResizeDropCallback))}};
AdfDhtmlTableBasePeer.prototype.HandleComponentMouseDown=function(a){if(!a.isCanceled()){var b=a.getNativeEvent(),d=this.__getColumnHeaderMouseAction(b),e=d?d.type:null;if((this._virtInitialized||"clearAllFilter"==e)&&this.__isOwnComponentEvent(a)){var f=AdfAgent.AGENT,g=f.getEventTarget(b),h=this.__getColumnHeader();h&&"readOnly"!=this.getComponent().getEditingMode()&&AdfDomUtils.disableTabStop(h,!1);var k=this.GetRowKeyAndRow(g,this.getDomElement());if(null!=k&&(h=k[0],k=k[1],null!=h)){this._getExpandAction(g)||
!this._isClickToEdit()||this._getActiveRowKey()==h&&!this.getComponent().getProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY)?this._handleRowMouseDown(b,g,f.isLeftButton(b),f.isSelectionToggle(b),b.shiftKey,h,k):(d={evt:b,targetNode:g,isLeftButton:f.isLeftButton(b),toggleKeyDown:f.isSelectionToggle(b),shiftKeyDown:b.shiftKey,rowKey:h,row:k},this._handleRowMouseDownTimerId=AdfPage.PAGE.scheduleTimer(this,this._handleRowMouseDownForC2E,d,10),this._ignoreRowClick=!0);return}f.isLeftButton(b)&&(h=this._isTargetCellFilter(g),
this._isTargetCellEditable(g,h)&&"clearAllFilter"!=e?h&&(this._editableTableReadOnlyMode&&this._setReadOnlyMode(!1,g,!1),this._setHeaderCellFocus(this._getParentTH(b))):e&&("selectAll"==e?(this._grabFocus(),(b=this.getComponent().getSelectedRowKeys())&&b[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]?(this._selUnselectAll(),this._queueColumnSelectionEvent()):this._selSelectAll()):"clearAllFilter"==e?(b=this.getComponent(),f=new AdfQueryEvent(b),f.setClearAll(!0),b.queueEvent(f),b.setSelectedRowKeys(null)):
"resize"==e?this.__handleColumnResizing(a,d):"move"==e?(this._mdPos=f.getMousePosition(b),this._reorderTH=d.cell,a.cancel()):"select"==e&&(this._grabFocus(),a=d.colIndices,0<a.length&&(b.shiftKey||(this._anchorColumnHeader=d.cell),this._doColumnSelections(b,a,d.colIds),this._isMultipleColumnSelect()&&(null==this._handleColumnHeaderDragCallback&&(this._handleColumnHeaderDragCallback=this.createCallback(this._handleColumnHeaderDrag),this._handleColumnHeaderDropCallback=this.createCallback(this._handleColumnHeaderDrop)),
a=this.__getColumnHeader(),f.disableUserSelect(a),AdfPage.PAGE.startDrag(b,this._handleColumnHeaderDragCallback,null)))),"resize"!=e&&"sort"!=e&&null!=d.cell&&this._setHeaderCellFocus(d.cell)))}}};AdfDhtmlTableBasePeer.prototype.HandleComponentMouseUp=function(a){this._reorderTH=this._mdPos=null};
AdfDhtmlTableBasePeer.prototype._selectInputOnMouseUp=function(a){var b,d;null!=a.selectionStart&&(b=0<a.selectionEnd-a.selectionStart);d=AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&9>AdfAgent.AGENT.getVersion()?this.getDomDocument().selection.createRange().text:window.getSelection().toString();b||""==d||a.select()};
AdfDhtmlTableBasePeer.prototype.HandleComponentDblClick=function(a){this._virtInitialized&&this.__isOwnComponentEvent(a)&&this._isTargetCellEditable(a.getNativeEventTarget())&&(this._ctePatternStart=void 0)};
AdfDhtmlTableBasePeer.prototype._getOnlyTextNode=function(a){var b=a.ownerDocument,d=null;if(b.evaluate&&AdfAgent.AGENT.getPlatform()!=AdfAgent.EDGE_PLATFORM)a=b.evaluate(".//text()",a,null,XPathResult.ANY_TYPE,null),(d=a.iterateNext())&&a.iterateNext()&&(d=null);else{(b=a.firstChild)&&3==b.nodeType&&(d=b);a=a.getElementsByTagName("*");for(var e=a.length,f=0;f<e;f++)if((b=a[f].firstChild)&&3==b.nodeType)if(d){d=null;break}else d=b}return d};
AdfDhtmlTableBasePeer.prototype._isCellTruncated=function(a){var b=a.cloneNode(!0),d=!1;AdfAgent.AGENT.copyStyle(a,b);b.style.width="";for(var e=b.getElementsByTagName("input"),f=e.length-1;0<=f;f--){var g=e[f];g.id="";g.name=""}e=this.getDomElement();f=a.ownerDocument.createElement("table");e.appendChild(f);f.insertRow(-1).appendChild(b);a.offsetWidth<b.offsetWidth&&(d=!0);e.removeChild(f);return d};
AdfDhtmlTableBasePeer.prototype.getClickLocation=function(a){var b=AdfAgent.AGENT,d=this.__getColumnHeader(),e;d&&(e=b.getElementPosition(d));a=b.getMousePosition(a);return d&&a.y-e.y<=this._cachedCHHeight?"header":"body"};
AdfDhtmlTableBasePeer.prototype.HandleComponentContextMenu=function(a){var b=a.getNativeEvent(),d=AdfAgent.AGENT;if(a.isPositionalRequest())if("header"===this.getClickLocation(b))this._handleColumnContextMenu(b);else{if(a=d.getEventTarget(b),!this._isTargetCellEditable(a)){d=this.GetRowKeyAndRow(a,this.getDomElement());if(null!=d&&(a=d[0],d=d[1],null!=a)){this.HandleRowContextMenu(b,a,d);return}this._handleBodyContextMenu(b)}}else this._handleKeyboardContextMenu(b,!1)};
AdfDhtmlTableBasePeer.prototype._hideColumnSortableIndicator=function(a,b){if(b&&2>b.colSpan){var d=AdfRichUIPeer.CreateSubId(b.id,AdfDhtmlTableBasePeer.__SORT_INDICATOR),d=a.getElementById(d);if(null!=d){var e=d.getAttribute(AdfDhtmlTableBasePeer._SORTED_TYPE),f=d.getAttribute(AdfDhtmlTableBasePeer._SUPPORTS_HOVER);null==e&&f&&(d.style.visibility="hidden")}}};
AdfDhtmlTableBasePeer.prototype.HandleComponentClick=function(a){if(a.isCanceled()||!this.__isOwnComponentEvent(a))return!1;var b=this.getComponent(),d=AdfAgent.AGENT,e=a.getNativeEvent(),f=d.getEventTarget(e),g=this.GetRowKeyAndRow(f,this.getDomElement());if(null!=g){var h=g[0],g=g[1];if(null!=h)return a.isLeftButtonPressed()&&(a=this._getExpandAction(f),"expand"==a?b.setDisclosedRowKey(h,!0):"collapse"==a?b.setDisclosedRowKey(h,!1):this._handleRowClick(f,d.isLeftButtonClick(e),d.isSelectionToggle(e),
e.shiftKey,h,g)),!0}if(!this._headerless&&(h=this.__getColumnHeaderMouseAction(e))&&"sort"==h.type&&!a.isCanceled())return this._isClickToEdit()&&this._getActiveRowKey()?(this._enterReadOnlyMode(a,!1),f=AdfPage.PAGE,a={},a.table=b,a.properties=[h.sortProperty],a.orders=[h.sortOrder],f.scheduleTimer(this,this._delayedQueueSortEvent,a,100)):AdfTableUtils.queueSortEvent(b,[h.sortProperty],[h.sortOrder]),d.eatEvent(e),!1;this._hasNavBar&&this.__handleNavBarItemsClick(e,f);this._isLoadMore&&this.__handleLoadMoreItemsClick(e,
f);return!0};AdfDhtmlTableBasePeer.prototype._delayedQueueSortEvent=function(a){AdfTableUtils.queueSortEvent(a.table,a.properties,a.orders)};AdfDhtmlTableBasePeer.prototype.HandleComponentValueChange=function(a){this._handleComponentEventForFilterCell(a)};AdfDhtmlTableBasePeer.prototype._handleComponentEventForFilterCell=function(a){if(!a.isCanceled()){var b=a.getSource(),d=b.getPeer();d.bind(b);b=d.getDomElement();this._isTargetCellFilter(b)&&a.propagatesToServer()&&this._handleFilterCellAction()}};
AdfDhtmlTableBasePeer.prototype._skipScrollRequest=function(){return AdfAgent.AGENT.getPlatform()==AdfAgent.WEBKIT_PLATFORM&&this._scrollTopUpdating&&(!this._isTouch||"Windows"==AdfAgent.guessOS())&&this._currentScrollTop==this._getScrollTop()};
AdfDhtmlTableBasePeer.prototype.HandleDomScroll=function(a,b){if(!this._skipScrollRequest()){var d=this.__getScrollLeft(),e;e=null!=this._associatedPeer&&AdfAgent.AGENT.getPlatform()==AdfAgent.GECKO_PLATFORM&&null!=a.getProperty("_afrSlaveId")?-1:this._getScrollTop();this.scrollToPos(d,e);this._associatedPeerScroll(-1,e)}};
AdfDhtmlTableBasePeer.prototype._associatedPeerScroll=function(a,b,d){if(null!=this._associatedPeer)if(d=d?++d:1,this._associatedPeer._virtInitialized)this._associatedPeer.scrollToPos(a,b);else if(4>d){var e=this;setTimeout(function(){e._associatedPeerScroll(a,b,d)},0)}else AdfLogger.LOGGER.severe("Tried 3 times w/ _associatedPeerScroll "+a+" : "+b)};
AdfDhtmlTableBasePeer.prototype._handleInnerTableScroll=function(a){a||(a=AdfPage.PAGE.getDomWindow().event);var b=AdfAgent.AGENT.getEventTarget(a);null!=this._touchMoveManager&&(b=a.target);a=Math.round(AdfAgent.AGENT.getScrollLeft(b));this.scrollToPos(a,-1)};
AdfDhtmlTableBasePeer.prototype._handleDataBodyScroll=function(){var a=-1,b,d;if(this._skipScrollRequest())if(b=this.GetDataBody(),d=b.firstChild){var e=AdfAgent.AGENT.getScrollLeft(b);if(e==this._currentScrollLeft)return;this._hasFrozenColumn()||(a=e)}else return;!0===this._handleDataCallbackBeingProcessed?(null!=this._handleDataBodyScrollTimeout&&(window.clearTimeout(this._handleDataBodyScrollTimeout),delete this._handleDataBodyScrollTimeout),this._handleDataBodyScrollTimeout=window.setTimeout(this.createCallback(this._handleDataBodyScroll),
0)):(b||(b=this.GetDataBody()),d||(d=b.firstChild),d&&(d=Math.round(b.scrollTop+d.startPos-parseInt(this._hShiftDataBody)-parseInt(this._hShiftLoadMoreDataBody)),this._hasFrozenColumn()||-1!=a||(a=AdfAgent.AGENT.getScrollLeft(b)),this.scrollToPos(a,d),this._associatedPeerScroll(-1,d)))};AdfDhtmlTableBasePeer.prototype.__getScrollPos=function(){return null!=this.GetScroller()?{x:this.__getScrollLeft(),y:this._getScrollTop()}:null};
AdfDhtmlTableBasePeer.prototype.__restoreScrollerPositions=function(a,b){this._setScrollTop(b);this._setScrollLeft(a)};
AdfDhtmlTableBasePeer.prototype.scrollToPos=function(a,b,d,e){var f=this.getComponent(),g=AdfDhtmlTableBasePeer.NO_SCROLL;void 0===e&&(e=!0);if(-1!=b&&this._currentScrollTop!=b)for(delete this._cachedFirstVisibleRowKeyAndRow,d||f.setProperty("scrollTop",b,!0,AdfUIComponent.PROPAGATE_ALWAYS),this._setScrollTop(b),g=this._handleVerticalScroll(b,e),this._isPaged||(b=this.GetFirstVisibleRowKeyAndRow(),null!=b.rowKey&&f.setProperty("scrollTopRowKey",b.rowKey,!0,AdfUIComponent.PROPAGATE_ALWAYS)),b=this.GetDataBody().childNodes,
e=b.length-1;0<=e;e--)this._synchronizeRowHeights(b[e]);-1!=a&&this._currentScrollLeft!=a&&(d||f.setProperty("scrollLeft",a,!0,AdfUIComponent.PROPAGATE_ALWAYS),this._setScrollLeft(a),this._handleHorizontalScrollDelayed(a));return g};
AdfDhtmlTableBasePeer.prototype._handleHorizontalScrollDelayed=function(a){var b=this;AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM?(this._latestScrollLeft=a,this._delayHScrolling||(this._delayHScrolling=window.requestAnimationFrame?window.requestAnimationFrame(function(){b._handleHorizontalScroll(b._latestScrollLeft)}):setTimeout(function(){b._handleHorizontalScroll(b._latestScrollLeft)},50))):this._handleHorizontalScroll(a)};
AdfDhtmlTableBasePeer.prototype.HandleDomKeyDown=function(a,b){var d=AdfAgent.AGENT,e=a.getClientId(),f=d.getEventTarget(b),g=b.keyCode;switch(g){case AdfKeyStroke.ARROWUP_KEY:case AdfKeyStroke.ARROWDOWN_KEY:case AdfKeyStroke.ARROWRIGHT_KEY:case AdfKeyStroke.ARROWLEFT_KEY:case AdfKeyStroke.HOME_KEY:case AdfKeyStroke.END_KEY:e=!0;this._isTargetCellEditable(f)||(g==AdfKeyStroke.HOME_KEY||g==AdfKeyStroke.END_KEY?this._handleHomeEndKey(g,b):this._handleArrow(g,b),e=!1);e||d.eatEvent(b);break;case AdfKeyStroke.ENTER_KEY:d=
this._getParentTH(b),g=AdfRichUIPeer.CreateSubId(e,AdfDhtmlTableBasePeer._NAVBAR_PAGE_INPUT),d&&null!=d.getAttribute("_afrFH")?(e=new AdfQueryEvent(a),e.setClearAll(!0),a.queueEvent(e),a.setSelectedRowKeys(null)):f.id==g&&(d=parseInt(this.GetRows()),0<d&&(f=(f.value-1)*d,0<=f?this._handlePageRowClick(f,b):(d=AdfPage.PAGE.getLookAndFeel(),f=d.getTranslatedString("af_table.MSG_NAVBAR_PAGE_INVALID"),d=d.getTranslatedString("af_table.MSG_NAVBAR_PAGE_INVALID_DETAIL"),f=new AdfFacesMessage(AdfFacesMessage.TYPE_ERROR,
f,d),AdfPage.PAGE.clearMessages(e),AdfPage.PAGE.hasMessages(null)&&AdfPage.PAGE.clearMessages(null),AdfPage.PAGE.addMessage(e,f),a.focus())))}};
AdfDhtmlTableBasePeer.prototype._handleHorizontalScroll=function(a){if(this._delayHScrolling&&(delete this._delayHScrolling,!this.getDomElement()))return;var b=AdfAgent.AGENT,d=this.GetDataBody();if(this._hasFrozenColumn())for(this._headerless||AdfDhtmlTableBasePeer._scrollColumnHeader(this.__getColumnHeader(),a),this._footerless||AdfDhtmlTableBasePeer._scrollColumnFooter(this._getColumnFooter(),a),b=d.childNodes,d=0;d<b.length;d++)this._positionInnerTable(b[d],a);else this._headerless||b.setScrollLeft(this.__getColumnHeader(),
a),this._hasSingleScroller()||b.setScrollLeft(this._getColumnFooter(),a),b.setScrollLeft(d,a)};
AdfDhtmlTableBasePeer.prototype._handleVerticalScroll=function(a,b){if(this._pendingFetch!=AdfTableDataFetchEvent.EXPAND_SUBTYPE&&this._pendingFetch!=AdfTableDataFetchEvent.COLLAPSE_SUBTYPE&&!this._insertDeleteAnimationInEffect){var d=this.GetDataBody();if(this._isPaged)return d.scrollTop=a,AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED;if(this._isLoadMore)return d.scrollTop=a,this._checkLoadMore(),AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED;d=this._fillViewPort(d,d.offsetHeight,b,!0);null!=this._selectionRequest&&
(d==AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED?this._processSelectionRequest():d!=AdfDhtmlTableBasePeer.MISSING_BEFORE&&d!=AdfDhtmlTableBasePeer.MISSING_AFTER&&delete this._selectionRequest);null!=this._clickEditRequest&&d==AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED&&this._processClickToEditActivateRequest();return d}};
AdfDhtmlTableBasePeer.prototype._fillViewPort=function(a,b,d,e){var f=AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED;if(this._isPaged)return this._hideStatus(),AdfDhtmlTableBasePeer.SetCursor(a,""),this.AdjustAutoHeight(),f;if(this._isLoadMore)return this._stretchTheColumns(),f=this._isViewportSatisfied(a,b),f&AdfDhtmlTableBasePeer.MISSING_AFTER?this._addBelow(a,b,d,e):(this._hideStatus(),AdfDhtmlTableBasePeer.SetCursor(a,""),this.AdjustAutoHeight()),f;0<this._knownRowCount&&(f=this._isViewportSatisfied(a,
b),f==AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED?(this._repositionBlocksForScroll(a),this._hideStatus(),AdfDhtmlTableBasePeer.SetCursor(a,""),b=(this._canvasHeightLimited?AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT:this._canvasHeight)-b,0<b&&(this._currentScrollTop<b/2?this._checkStart(a):this._checkEnd(a)),this.AdjustAutoHeight()):f&AdfDhtmlTableBasePeer.MISSING_BEFORE?this._addAbove(a,b,d,e):f&AdfDhtmlTableBasePeer.MISSING_AFTER?(this._isPrefetching&&this._repositionBlocksForScroll(a),this._addBelow(a,
b,d,e)):this._handleLongJump(a,b,d,e));return f};AdfDhtmlTableBasePeer.prototype._isScrollerTop=function(){var a=null,a=this._hasSingleScroller()&&!this._isPaged?this.GetScroller():this.GetScroller()[AdfDhtmlTableBasePeer._VSCROLLER],b=Math.ceil((0<this._averageRowHeight?this._averageRowHeight:1)/2),b=b>AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE?AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE:b;return a.scrollTop<b?!0:!1};
AdfDhtmlTableBasePeer.prototype._isScrollerBottom=function(){if(null==this.GetScroller())return!1;var a=null,a=this._hasSingleScroller()&&!this._isPaged?this.GetScroller():this.GetScroller()[AdfDhtmlTableBasePeer._VSCROLLER];if(0==a.scrollTop)return!1;var b=Math.ceil((0<this._averageRowHeight?this._averageRowHeight:1)/2),b=b>AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE?AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE:b;AdfAgent.guessOS()==AdfAgent.ANDROID_OS&&(b=Math.ceil(a.offsetHeight/10));return a.scrollHeight-
a.scrollTop-a.offsetHeight<=b?!0:!1};
AdfDhtmlTableBasePeer.prototype._isScrollerRight=function(){if(null==this.GetScroller())return!1;var a=null,a=this._hasSingleScroller()&&!this._isPaged?this.GetScroller():this.GetScroller()[AdfDhtmlTableBasePeer._HSCROLLER];if(0==a.scrollLeft)return!1;var b=a.scrollWidth-a.clientWidth,d=Math.ceil((0<this._averageRowHeight?this._averageRowHeight:1)/2),d=d>AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE?AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE:d;return b-a.scrollLeft<=d?!0:!1};
AdfDhtmlTableBasePeer.prototype._checkLoadMore=function(){if(this._isLoadMore){var a=AdfAgent.AGENT,b=this.getComponent(),d=this.GetDataBody();this._loadMoreAdjWidth=this._loadMoreFullWidth=d.style.width;if(this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_AUTOHIDE){var e=this.getDomElement();this._loadMoreAdjWidth=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(e.id,AdfDhtmlTableBasePeer._DATAWRAPPER)).style.width}var e=d.childNodes,f=this._getLoadMore(!1),g=this._getLoadMore(!0),
h=!1,k=!1,l=this.GetScroller();null==l||this._hasSingleScroller()||(l=l[AdfDhtmlTableBasePeer._VSCROLLER]);var m=0<this._getScrollbarWidth()?!0:!1,l=null==l?!1:l.scrollHeight>l.clientHeight?!0:!1;this._isScrollerBottom()||!m&&!l?this._checkMoreHasRows(d,!1)&&(h=!0):this._isScrollerTop()&&this._checkMoreHasRows(d,!0)&&(k=!0);if(h){if(this._isImplicitLoadMore&&!this._implicitLoadMoreFetched)this._loadMoreFetch(!0),this._implicitLoadMoreFetched=!0;else if(!this._isBottomLoadMoreDisplayed&&!this._isImplicitLoadMore){this._hShiftLoadMoreDataBody=
(m||l)&&d.scrollHeight+this._cachedFMHeight>=d.clientHeight?-1*this._cachedFMHeight+"px":"0px";d.style.top=parseInt(this._hShiftLoadMoreDataBody)+parseInt(this._hShiftDataBody)+"px";f.style.top=parseInt(this._hShiftLoadMoreDataBody)+parseInt(this._hShiftDataBody)+"px";f.style.display="block";f.style.width=this._loadMoreAdjWidth;this._isBottomLoadMoreDisplayed=!0;if(!this._bottomLoadMoreHeight){var n=f.offsetHeight;n&&(h=f.childNodes[0].childNodes[0].offsetHeight,h=Math.ceil((n-h)/2),this._isTouch?
(f=a.getElementById(AdfRichUIPeer.CreateSubId(b.getClientId(),AdfDhtmlTableBasePeer._LOAD_MORE_BOTTOM_LINK)),f.style.paddingTop=h+"px",f.style.display="inline-block"):f.childNodes[0].style.top=h+"px",this._bottomLoadMoreHeight=n)}m||l||this._adjustCanvasHeight(this._bottomLoadMoreHeight,d,!1)}m=e.length;d=e[0];m=e[m-1];this._updateLoadMoreItemsRangeText(d.startRow,m.startRow+m.numRows,this._knownRowCount,!1)}else this._isImplicitLoadMore&&this._implicitLoadMoreFetched?this._implicitLoadMoreFetched=
!1:this._isBottomLoadMoreDisplayed&&!this._isImplicitLoadMore&&(d.style.top="0px",f.style.top="0px",f.style.display="none",this._isBottomLoadMoreDisplayed=!1,this._hShiftLoadMoreDataBody="0px");k?(this._isImplicitLoadMore&&!this._implicitLoadMoreFetched?this._loadMoreFetch(!1):this._isTopLoadMoreDisplayed||this._isImplicitLoadMore||(g.style.display="block",g.style.width=this._loadMoreAdjWidth,this._isTopLoadMoreDisplayed=!0,this._topLoadMoreHeight||!(k=g.offsetHeight))||(h=g.childNodes[0].childNodes[0].offsetHeight,
h=Math.ceil((k-h)/2),this._isTouch?(a=a.getElementById(AdfRichUIPeer.CreateSubId(b.getClientId(),AdfDhtmlTableBasePeer._LOAD_MORE_TOP_LINK)),a.style.paddingTop=h+"px",a.style.display="inline-block"):g.childNodes[0].style.top=h+"px",this._topLoadMoreHeight=k),m=e.length,d=e[0],m=e[m-1],this._updateLoadMoreItemsRangeText(d.startRow,m.startRow+m.numRows,this._knownRowCount,!0)):this._isImplicitLoadMore&&this._implicitLoadMoreFetched?this._implicitLoadMoreFetched=!1:this._isTopLoadMoreDisplayed&&!this._isImplicitLoadMore&&
(g.style.display="none",this._isTopLoadMoreDisplayed=!1)}};AdfDhtmlTableBasePeer.prototype._checkMoreHasRows=function(a,b){for(var d=a.childNodes,e=d.length,f=0,g=!1,h=0;h<e;h++)null!=d[h].rows&&(f+=d[h].rows.length);0<f&&!this._allRowsAvailableOnClient(d,e)&&(f=d[0],d=d[e-1],b&&0<f.startRow?g=!0:!b&&(d.startRow+d.numRows<this.GetKnownRowCount()||0>this.GetRowCount())&&(g=!0));return g};
AdfDhtmlTableBasePeer.prototype._checkScrollbarHidingAffordance=function(){var a=this.GetDataBody();this._isScrollerBottom()?this._getScrollWidth()>this._getScrollerOffsetWidth()&&(this._hShiftDataBody=-1*(this._getScrollerOffsetHeight()-this._getScrollerClientHeight())-this._cachedCFHeight+"px",a.style.top=this._isBottomLoadMoreDisplayed?parseInt(this._hShiftDataBody)+parseInt(this._hShiftLoadMoreDataBody)+"px":this._hShiftDataBody):(this._hShiftDataBody="0px",a.style.top="0px")};
AdfDhtmlTableBasePeer.prototype._getPrefetchMarginHeight=function(){return this.getComponent().getFetchSize()/2*this._averageRowHeight};AdfDhtmlTableBasePeer.prototype._needPrefetch=function(a,b,d){return this._isScrollPrefetch&&this._currentScrollTop>this._averageRowHeight&&(-1==this._rowCount||0<=this._rowCount&&0<d)&&a>b&&(b+=this._getPrefetchMarginHeight(),a<b)?!0:!1};
AdfDhtmlTableBasePeer.prototype._isViewportSatisfied=function(a,b){var d=a.childNodes,e=d.length,f=AdfDhtmlTableBasePeer.NO_BLOCKS,g=this._currentScrollTop,h=0;this._isPrefetching=!1;for(var k=0;k<e;k++)h+=d[k].rows.length;if(0<h&&(f=AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED,!this._allRowsAvailableOnClient(d,e))){var h=d[0],d=d[e-1],e=this._canvasHeightLimited?AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT:this._canvasHeight,k=h.startPos-g,l=d.startPos+d.cachedHeight-g;if(0<k||0==g&&0<h.startRow)f|=AdfDhtmlTableBasePeer.MISSING_BEFORE;
this._isLoadMore?l<b?f|=AdfDhtmlTableBasePeer.MISSING_AFTER:this.isScrollPrefetch&&this._needPrefetch(l,viewPortHeight,this.GetKnownRowCount()-d.numRows-d.startRow)&&(f|=AdfDhtmlTableBasePeer.MISSING_AFTER,this._isPrefetching=!0):(l<b&&e>=b||g>=e-b&&d.startRow+d.numRows<this.GetKnownRowCount()?f|=AdfDhtmlTableBasePeer.MISSING_AFTER:this._isScrollPrefetch&&this._needPrefetch(l,b,this.GetKnownRowCount()-d.numRows-d.startRow)&&(f|=AdfDhtmlTableBasePeer.MISSING_AFTER,this._isPrefetching=!0),f!=AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED&&
(k>b||0>l)&&(f=AdfDhtmlTableBasePeer.NO_BLOCKS,this._isPrefetching=!1))}return f};AdfDhtmlTableBasePeer.prototype._addAbove=function(a,b,d,e){var f=a.childNodes,g=f.length,h=f[0];if(0==h.startRow){for(h=e=0;h<g;h++){var k=f[h],l=k.cachedHeight;k.startPos=e;e+=l}this._setScrollTop(0);this._fillViewPort(a,b,d)}else a=h.startRow,b=this._getBlockFirstRowKey(h),this._startFetch(AdfTableDataFetchEvent.BEFORE_KEY_SUBTYPE,a,b,d,!e)};
AdfDhtmlTableBasePeer.prototype._addBelow=function(a,b,d,e){var f=a.childNodes,g=f.length,h=f[g-1],k=h.startRow+h.numRows,l=this.GetRowCount();if(0<l&&k>=l){e=this._canvasHeight-b;h=this._canvasHeight;k=!1;for(--g;0<=g;g--)l=f[g],h-=l.cachedHeight,l.startPos!=h&&(k=!0,l.startPos=h);if(this._currentScrollTop!=e||k)this._setScrollTop(e),this._fillViewPort(a,b,d)}else a=k-1,f=this._getBlockLastRowKey(h),this._isPrefetching&&d&&(d=this._canvasHeightLimited?AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT:this._canvasHeight,
d=this._currentScrollTop+b+this._getPrefetchMarginHeight()<d),this._startFetch(AdfTableDataFetchEvent.AFTER_KEY_SUBTYPE,a,f,d,!e)};
AdfDhtmlTableBasePeer.prototype._handleLongJump=function(a,b,d,e){var f,g,h,k,l,m=this.getComponent().getFetchSize();f=this._currentScrollTop;k=this.GetKnownRowCount();var n=AdfPage.PAGE.getLookAndFeel();h=this._canvasHeightLimited?AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT:this._canvasHeight;g=-1==this.GetRowCount()||this._canvasHeightLimited?AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE:0;f>=h-g-b?(h=AdfTableDataFetchEvent.UP_TO_INDEX_SUBTYPE,g=k-1,f=n.getTranslatedString("af_table.LABEL_END"),-1==
this.GetRowCount()&&(f=n.getTranslatedString("af_table.LABEL_ROW",g+1)),l=g,k=l-m+1):(h=AdfTableDataFetchEvent.FROM_INDEX_SUBTYPE,0==f?(f=n.getTranslatedString("af_table.LABEL_START"),g=0):(g=Math.round(f/this._averageRowHeight),f=n.getTranslatedString("af_table.LABEL_ROW",g+1),AdfAssert.assert(g<k)),k=g,l=g+m-1);var q=a.childNodes;if(0<q.length){m=q[q.length-1];q=q[0].startRow;m=m.startRow+m.numRows;if(k>=q&&k<m){this._addBelow(a,b,d,e);return}if(l>=q&&l<m){this._addAbove(a,b,d,e);return}}d&&this.DisplayStatus(n.getTranslatedString("af_table.LABEL_GOING_TO",
f));this._startFetch(h,g,null,d,!e)};
AdfDhtmlTableBasePeer.prototype._deleteOffscreenBlocks=function(a,b,d){var e=this.getComponent(),f=this,g=a.childNodes,h=g.length,k,e=this._isTouch?this._maxCachedRowsForTouch:e.getMaxClientRows?e.getMaxClientRows():-1;if(0<h&&(k=g[h-1],k=k.startRow-g[0].startRow+k.numRows,k<=e))return;var l=!0;g[0]!=d&&(l=!1);var m=function(e,h){var k=g[e];if(k==d)return h;var l=k.startPos-n;if(0>l+k.cachedHeight||l>b){if(f._isLoadMore){l=k.startPos;0==l&&e+1<g.length&&(l=g[e+1].startPos);for(var m=e+1;m<g.length;m++)g[m].startPos-=
l;f._adjustCanvasHeight(-1*k.cachedHeight,a);0<f._currentScrollTop-l&&f._setScrollTop(f._currentScrollTop-l)}l=k.numRows;f._unregisterNode(k);a.removeChild(k);h-=l}return h},n=this._currentScrollTop;if(l)for(l=h-1;0<=l&&!(k<=e);l--)k=m(l,k);else for(l=0;l<h&&!(l>g.length-1||k<=e);l++)k=m(l,k)};AdfDhtmlTableBasePeer.prototype._unregisterNode=function(a){AdfPage.PAGE.removeComponentsInSubtree(a);AdfAgent.AGENT.elementsRemoved(a)};
AdfDhtmlTableBasePeer.prototype._repositionBlocksForScroll=function(a){var b=a.firstChild,d=this._currentScrollTop;b&&(a.scrollTop=d-b.startPos);this._isTouch&&"Windows"!=AdfAgent.guessOS()||AdfAgent.AGENT.getPlatform()!=AdfAgent.WEBKIT_PLATFORM||(this._scrollTopUpdating=!0,setTimeout(AdfDhtmlTableBasePeer._resetScrollTopUpdating,100,this))};AdfDhtmlTableBasePeer._resetScrollTopUpdating=function(a){a._scrollTopUpdating=!1};
AdfDhtmlTableBasePeer.prototype._undoScroll=function(){var a=this.GetDataBody(),b=a.firstChild;b&&this._setScrollTop(b.startPos+a.scrollTop)};AdfDhtmlTableBasePeer.prototype._restoreSavedDisclosureState=function(){this.getComponent().setProperty("disclosedRowKeys",this._savedDisclosedState,!1,AdfUIComponent.PROPAGATE_NEVER);this._savedDisclosedState=void 0};
AdfDhtmlTableBasePeer.prototype._queueFetchEvent=function(a,b,d,e){var f=this._fetchId++,g=this.getComponent(),h=new AdfTableDataFetchEvent(g,f,b,d,e);h.setPartial(!0);h.setRenderOnly(a);var k=!1;a?AdfPage.PAGE.queueEventToServer(h):(g.queueEvent(h),k=h.isCanceled());k||(this._pendingFetch=b,this._pendingId=f,this._fetchIndex=d,this._fetchKey=e,this._pendingRenderOnly=a);return k?null:h};
AdfDhtmlTableBasePeer.prototype._checkViewportSize=function(a){var b=a.childNodes;0!=b.length&&(b=b[0],void 0!==b.numRows&&(a=Math.round(a.clientHeight/(b.offsetHeight/b.numRows)+.5),b=this.getComponent(),this._isSyncRows&&this.isInteger(a)&&0<=a&&b.setProperty("viewportSize",a,!1,AdfUIComponent.PROPAGATE_ALWAYS)))};
AdfDhtmlTableBasePeer.prototype._startFetch=function(a,b,d,e,f){if(a!=this._pendingFetch||b!=this._fetchIndex||d!=this._fetchKey)e?(e=function(){var a=arguments.callee;a._self._delayedNavigate(a._sTop,a._subtype,a._index,a._key,a._renderOnly)},e._sTop=this._currentScrollTop,e._subtype=a,e._index=b,e._key=d,e._renderOnly=f,e._self=this,setTimeout(e,300),this.CancelPendingFetch()):(a=this._queueFetchEvent(f,a,b,d))?(this._isPrefetching||(b=AdfPage.PAGE.getLookAndFeel().getTranslatedString("af_table.LABEL_FETCHING"),
this.DisplayStatus(b),AdfDhtmlTableBasePeer.SetCursor(this.GetDataBody(),"wait")),this._pruneKeyCache&&(a.setClientTokens(this._collectClientTokens(this._pruneKeyCache)),this._pruneKeyCache=null)):this._undoScroll()};AdfDhtmlTableBasePeer.prototype._delayedNavigate=function(a,b,d,e,f){this._currentScrollTop==a&&this._startFetch(b,d,e,!1,f)};AdfDhtmlTableBasePeer.prototype.CancelPendingFetch=function(){this._pendingRenderOnly=this._pendingId=this._fetchKey=this._fetchIndex=this._pendingFetch=void 0};
AdfDhtmlTableBasePeer.prototype.IsFetchPending=function(){return void 0!=this._pendingFetch};AdfDhtmlTableBasePeer.prototype.isDisclosureFetchPending=function(){return this._pendingFetch==AdfTableDataFetchEvent.EXPAND_SUBTYPE||this._pendingFetch==AdfTableDataFetchEvent.COLLAPSE_SUBTYPE};AdfDhtmlTableBasePeer.prototype._rowIndexToBlock=function(a){for(var b=this.GetDataBody().childNodes,d=0;d<b.length;d++){var e=b[d],f=e.startRow;if(a>=f&&a<=f+e.numRows)return e}return null};
AdfDhtmlTableBasePeer.prototype._splitBlock=function(a,b){AdfAssert.assert(0<=b);AdfAssert.assert(b<a.numRows);var d=a.cloneNode(!1);d.numRows=a.numRows-b;var e=AdfDomUtils.getFirstDescendentElement(a,"TBODY");AdfAssert.assert(null!=e,"Illegal State: data block with no tbody");for(var f=e.cloneNode(!1),g=a.rows,h=a.numRows-1;h>=b;h--){var k=g[h];e.removeChild(k);f.insertBefore(k,f.firstChild)}e=AdfAgent.AGENT;this._processColGroup()&&(h=AdfDomUtils.getFirstDescendentElement(a,"COLGROUP"))&&d.appendChild(h.cloneNode(!0));
d.appendChild(f);f=d.rows[0].cells;g=g[0].cells;h=f.length;for(k=0;k<h;k++)f[k].style.width=g[k].style.width;e.elementsAdded(d);a.numRows=b;a.cachedHeight=a.offsetHeight;return d};AdfDhtmlTableBasePeer.prototype._truncateBlock=function(a,b){AdfAssert.assert(0<=b);AdfAssert.assert(b<a.numRows);for(var d=a.rows,e=a.numRows-1;e>=b;e--)this._unregisterNode(d[e]),a.deleteRow(e);a.numRows=b;a.cachedHeight=a.offsetHeight};
AdfDhtmlTableBasePeer.prototype._insertBlockDom=function(a,b,d,e,f,g){var h=null;e-=b.startRow;0!=e&&(e<b.numRows&&(f==g?h=this._splitBlock(b,e):this._truncateBlock(b,e)),b=b.nextSibling);a.insertBefore(d,b);return h};
AdfDhtmlTableBasePeer.prototype.InsertBlock=function(a,b,d,e,f){this._initNewBlock(a,b,d);var g=this.GetDataBody(),h=g.offsetHeight;this._sizeBlockForFrozenColumns(a,g.offsetWidth);this._registerInnerScrollCallback(a);this._stretchLastBlockColumn(a);var k=this._rowIndexToBlock(b);AdfAssert.assert(k);var l=this._insertBlockDom(g,k,a,b,d,e);this.SetNewBlockScrollLeft(a);a.cachedHeight=a.offsetHeight;a.startPos=b==k.startRow?k.startPos:k.startPos+k.cachedHeight;this._synchronizeRowHeights(a);l&&(g.insertBefore(l,
a.nextSibling),l.cachedHeight=l.offsetHeight,this.SetNewBlockScrollLeft(l));if(d==e){for(k=a;l=k.nextSibling;)l.startRow=k.startRow+k.numRows,l.startPos=k.startPos+k.cachedHeight,k=l;k=a.cachedHeight}else{for(k=g.lastChild;a!=k;)this._unregisterNode(k),g.removeChild(k),k=g.lastChild;k=this._averageRowHeight*e}this._knownRowCount+=e;-1!=this._rowCount&&(this._rowCount+=e);this._adjustCanvasHeight(k,g);0==f&&(this.isHeightAutoSized()||this._deleteOffscreenBlocks(g,h,a),this._stretchTheColumns(),this._checkForScrollableLastBlockInViewport(g),
this.BlockInserted(a,b,d))};AdfDhtmlTableBasePeer.prototype._initNewBlock=function(a,b,d){a.style.position="relative";a.startRow=b;a.numRows=d};AdfDhtmlTableBasePeer.prototype.SetNewBlockScrollLeft=function(a){var b=this._currentScrollLeft;this._hasFrozenColumn()&&0!=b&&this._positionInnerTable(a,b)};
AdfDhtmlTableBasePeer.prototype._adjustCanvasHeight=function(a,b,d,e){if(0!=a){var f=this._canvasHeight;if(this._isPaged||this._isLoadMore)this._canvasHeight+=a;else{var g=this._canvasHeight+a,h=-1==this.GetRowCount()?AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE:0,k=this.GetKnownRowCount();this._averageRowHeight=Math.round((g-h)/k);this._canvasHeight=this._averageRowHeight*k+h}this._setFakeCanvasHeight(this._canvasHeight);if(e&&(e=this._canvasHeight/f,f=b.firstChild)){g=f.startPos;f.startPos=Math.round(f.startPos*
e);g=f.startPos-g;for(f=f.nextSibling;f;)f.startPos+=g,f=f.nextSibling;this._setScrollTop(Math.round(this._currentScrollTop*e))}this._currentScrollTop=this._getScrollTop()}if(0!=a||d)a=this.getDomElement(),this.SizeDataBody(b,a.clientWidth,a.clientHeight)};
AdfDhtmlTableBasePeer.prototype._checkForScrollableLastBlockInViewport=function(a){var b=a.lastChild,d=b.startPos,e=b.previousSibling;null!=e&&e.cachedHeight!=e.offsetHeight&&(d=e.startPos+e.offsetHeight,e.cachedHeight=e.offsetHeight,b.startPos=d);null!=b&&this.GetRowCount()==b.startRow+b.numRows&&d+b.cachedHeight>this._canvasHeight&&(this._canvasHeight=d+b.cachedHeight,this._setFakeCanvasHeight(this._canvasHeight),b=this.getDomElement(),this.SizeDataBody(a,b.clientWidth,b.clientHeight))};
AdfDhtmlTableBasePeer.prototype.SizeDataBody=function(a,b,d){var e=AdfAgent.AGENT,f=this._getScrollbarWidth(),g=this._getScrollbarHeight();b=Math.max(0,b-f);a.style.width=b+"px";d=Math.max(0,d-this._cachedCHHeight-this._cachedCFHeight-this._cachedNBHeight-g);this._checkLoadMore();a.style.height=d+"px";this._headerless||(f=this.__getColumnHeader().style,f.width=a.style.width,0<g?f.borderRightWidth="":f.borderRightWidth="0px");this._footerless||(f=this._getColumnFooter().style,f.width=a.style.width,
0<g?f.borderRightWidth="":f.borderRightWidth="0px");!this.IsEmpty&&this._hasFrozenColumn()&&this._sizeRegionsForFrozenColumns(a,b);this._dataBodyHeight=d;this._checkViewportSize(a);this._scrollbarBehavior==AdfDhtmlTableBasePeer._SCROLLBAR_BEHAVIOR_AUTOHIDE&&(a=this.getDomElement(),b=e.getElementById(AdfRichUIPeer.CreateSubId(a.id,AdfDhtmlTableBasePeer._DATAWRAPPER)))&&(g=e=0,this._hasSingleScroller()&&!this._isPaged?(vscroller=this.GetScroller(),hscroller=this.GetScroller()):(vscroller=this.GetScroller()[AdfDhtmlTableBasePeer._VSCROLLER],
hscroller=this.GetScroller()[AdfDhtmlTableBasePeer._HSCROLLER]),null!=hscroller&&(g=hscroller.offsetHeight-hscroller.clientHeight),null!=vscroller&&(e=vscroller.offsetWidth-vscroller.clientWidth),this._scrollbarHidden&&(a.style.borderRight=0<e?"0px":"",a.style.borderBottom=0<g&&0==this._cachedNBHeight?"0px":"",a.style.backgroundColor=this.IsEmpty?"":"transparent",g=e=0),b=b.style,b.height=a.offsetHeight-this._cachedCHHeight-this._cachedCFHeight-this._cachedNBHeight-g+"px",b.width=a.offsetWidth-e+
"px");return d};AdfDhtmlTableBasePeer.prototype._getScrollbarWidth=function(){if(this.IsEmpty)return 0;var a=0,b=this.GetScroller();if(!this._hasSingleScroller()||this._isPaged)b=b[AdfDhtmlTableBasePeer._VSCROLLER];0<b.clientWidth&&(a=b.offsetWidth-b.clientWidth);return a};
AdfDhtmlTableBasePeer.prototype._getScrollbarHeight=function(){var a;a=AdfAgent.AGENT.getPlatform()==AdfAgent.GECKO_PLATFORM;if(this.IsEmpty){var b=this.getDomElement();a=a?b.clientHeight:parseInt(window.getComputedStyle(b).height);a=b.offsetHeight-a}else{b=this.GetScroller();if(!this._hasSingleScroller()||this._isPaged)b=b[AdfDhtmlTableBasePeer._HSCROLLER];a=a?b.clientHeight:parseInt(window.getComputedStyle(b).height);a=3<a?b.offsetHeight-a:0}return a<AdfDhtmlTableBasePeer._SCROLLBAR_HEIGHT_TOLERANCE?
0:a};
AdfDhtmlTableBasePeer.prototype._handleDataCallback=function(a,b,d,e){var f=AdfAgent.AGENT,g=f.getIntAttribute(a,"_startRow",0),h=AdfDhtmlTableBasePeer._getBlockRowCount(a);if(b==AdfTableDataFetchEvent.EXPAND_SUBTYPE)return this.HandleExpand(a,h,e);if(b==AdfTableDataFetchEvent.COLLAPSE_SUBTYPE)return this.HandleCollapse(a,g,e);if(b==AdfTableDataFetchEvent.CLICK_EDIT_ACTIVE_ROW)return this.HandleClickToEditActiveRow(a,h,e);var k=this.GetDataBody();e=k.offsetHeight;var l=k.childNodes,m=l.length,n=this._currentScrollTop;
this._initNewBlock(a,g,h);0<h&&(this._sizeBlockForFrozenColumns(a,k.offsetWidth),this._registerInnerScrollCallback(a),this._stretchLastBlockColumn(a));this._handleDataCallbackBeingProcessed=!0;try{if(b==AdfTableDataFetchEvent.FROM_INDEX_SUBTYPE||b==AdfTableDataFetchEvent.UP_TO_INDEX_SUBTYPE){this.RemoveAllBlocks(k);k.appendChild(a);var q=a.offsetHeight;this._adjustRowCountFromResponse(k,a,h,q);d=0;if(n>=(this._canvasHeightLimited?AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT:this._canvasHeight)-e||this._canvasHeightLimited&&
this.GetRowCount()==a.startRow+a.numRows)d=q-e;a.startPos=n-d;a.cachedHeight=q}else{if(b==AdfTableDataFetchEvent.AFTER_KEY_SUBTYPE){var r=l[m-1];if(0==h)if(-1==this.GetRowCount()){var t=f.getIntAttribute(r,"_rowCount",-1);this._rowCount=-1==t?this._knownRowCount:t;0==l[0].startPos&&r.startPos+r.cachedHeight<=this._canvasHeight&&(this._canvasHeight=r.startPos+r.cachedHeight,this._setFakeCanvasHeight(this._canvasHeight))}else this._adjustRowCountFromResponse(k,a);else{a.startPos=r.startPos+r.cachedHeight;
k.appendChild(a);a.cachedHeight=a.offsetHeight;var u=g-r.startRow-r.numRows;0!=u&&this.ShiftIndex(r,u,!1);this._adjustRowCountFromResponse(k,a);if(0!=u&&!this.IsReceivingActiveEvents())for(var v=r;v;){var w=v.previousSibling;this._unregisterNode(v);k.removeChild(v);v=w}var y=g+h-this.GetKnownRowCount();if(0<y){this._knownRowCount+=y;var z=a.cachedHeight;if(y<h)for(var z=0,B=a.rows,g=h-y;g<h;g++)z+=B[g].offsetHeight;this._adjustCanvasHeight(z,k)}else this._checkForScrollableLastBlockInViewport(k),
this._isLoadMore&&a&&0<a.cachedHeight&&(z=a.cachedHeight,this._adjustCanvasHeight(z,k));l=k.childNodes;m=l.length;this._allRowsAvailableOnClient(l,m)&&(r=l[m-1],this._canvasHeight=r.startPos+r.cachedHeight,this._setFakeCanvasHeight(this._canvasHeight))}}else if(b==AdfTableDataFetchEvent.BEFORE_KEY_SUBTYPE){var C=l[0];k.insertBefore(a,C);var A=a.offsetHeight;a.cachedHeight=A;if(this._isLoadMore){a.startPos=0;for(q=1;q<l.length;q++)l[q].startPos+=A;z=a.cachedHeight;this._adjustCanvasHeight(z,k)}else a.startPos=
C.startPos-A;u=g-C.startRow+h;0!=u&&this.ShiftIndex(C,u,!0);var E=this._adjustRowCountFromResponse(k,a);if((0!=u||0!=E)&&!this.IsReceivingActiveEvents())for(v=C;v;)w=v.nextSibling,this._unregisterNode(v),k.removeChild(v),v=w}d||this._deleteOffscreenBlocks(k,e,a);this._isLoadMore&&a&&0<a.cachedHeight&&this._checkLoadMore();this._repositionBlocksForScroll(k);this._processSelectionRequest();null!=this._clickEditRequest&&this._processClickToEditActivateRequest()}}finally{delete this._handleDataCallbackBeingProcessed}0!=
h&&(this.SetNewBlockScrollLeft(a),this._synchronizeRowHeights(a));this.UpdateRange(!1);return!0};
AdfDhtmlTableBasePeer.prototype._adjustRowCountFromResponse=function(a,b,d,e){var f=0,g=this.GetRowCount();if(-1!=g){var h=AdfAgent.AGENT.getIntAttribute(b,"_rowCount",-1);0==this._unavailableRowIndex?h=-1:0<this._unavailableRowIndex&&(h=this._unavailableRowIndex);-1!=h&&(f=h-g)}0!=f&&(this._rowCount=this._knownRowCount=h,this._adjustCanvasHeight(void 0!=d&&void 0!=e&&d==h?e-this._averageRowHeight*g:this._averageRowHeight*f,a,!1));return f};
AdfDhtmlTableBasePeer.prototype.HandleExpand=function(a,b,d){return this._handleExpandCollapse(a,d,!0)};AdfDhtmlTableBasePeer.prototype.HandleCollapse=function(a,b,d){return this._handleExpandCollapse(a,d,!1)};
AdfDhtmlTableBasePeer.prototype._handleExpandCollapse=function(a,b,d){var e=a.getAttribute("_startKey"),f=null;e&&(f=this.FindRowByKey(e));if(f){var g=AdfPage.PAGE,h=f.tr,e=f.block;this._changeDetailIcon(h,d);var k=e.cachedHeight,f=null,l;g.isAnimationEnabled()&&!this.isHeightAutoSized()&&(l=parseInt(g.getLookAndFeel().getSkinProperty("af|table-tr-detail-animation-duration")));d?(g=h.cells.length,a=a.rows[0],1<g&&(a.cells[0].colSpan=g),a.parentNode.removeChild(a),h.parentNode.insertBefore(a,h.nextSibling),
AdfAgent.AGENT.elementsAdded(a),0<l&&(f=a.cells[0])):(a=h.nextSibling,AdfAgent.getAgent().getAttribute(a,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)?(this._unregisterNode(a),0<l?(a.style.display="none",f=a.cells[0]):a.parentNode.removeChild(a)):AdfLogger.LOGGER.severe("Unable to locate detail row"));a=e.offsetHeight;e.cachedHeight=a;k=a-k;for(e=e.nextSibling;e;)e.startPos+=k,e=e.nextSibling;e=this.GetDataBody();this._adjustCanvasHeight(k,e);0==b&&(this._stretchTheColumns(),this._checkForScrollableLastBlockInViewport(e));
null!=f&&this._doDisclosureAnimation(f,l,d);return!0}return!1};
AdfDhtmlTableBasePeer.prototype._doDisclosureAnimation=function(a,b,d){var e=a.ownerDocument,e=d?e.createElement("div"):a.firstChild,f=e.style,g=0;if(d){f.overflow="hidden";f.height="1px";f.position="relative";g=AdfAgent.AGENT.getComputedStyle(a);f=AdfAgent.getCSSLengthAsInt;g=a.clientHeight-f(g.paddingTop)-f(g.paddingBottom);for(f=a.firstChild;f;)e.appendChild(f),f=a.firstChild;a.appendChild(e)}else a.parentNode.style.display="";AdfDhtmlElementAnimator.animate(AdfDhtmlElementAnimator.FRAME_METHOD_SLOW_FAST_SLOW,b,
[{element:e,properties:{height:g}}],null,d?null:AdfDhtmlTableBasePeer.CollapseAnimationComplete,d?null:{wrapper:a.parentNode,peer:this})};AdfDhtmlTableBasePeer.CollapseAnimationComplete=function(a){var b=a.wrapper;a=a.peer;b.parentNode.removeChild(b);a._insertDeleteAnimationInEffect=!1;a&&(a.SetAnimating(!1),a.delayedResizeNotify&&(a.delayedResizeNotify(),a.delayedResizeNotify=null),a.AdjustAutoHeight())};AdfDhtmlTableBasePeer.prototype.SetAnimating=function(a){this._animating=a};
AdfDhtmlTableBasePeer.prototype.BusyAnimating=function(){return this._animating};
AdfDhtmlTableBasePeer.prototype.HandleClickToEditActiveRow=function(a,b,d){delete this._oldActiveRowKey;if(0<b){b=this._columnStretching;null!=b&&"none"!=b&&(this._sizeBlockForFrozenColumns(a,this.GetDataBody().offsetWidth),this._stretchLastBlockColumn(a));b=a.rows;a=b[0];b=1<b.length&&this._hasDetailStamp?b[1]:null;var e=AdfAgent.AGENT.getAttribute(a,AdfDhtmlTableBasePeer._ROW_KEY);this._replaceRowByKey(e,a,b);this._hasFrozenColumn()&&this._syncRowHeight(a,a.offsetHeight);0==d&&this._handleClickToEditActiveRowAfter();
return!0}0==d&&this._handleClickToEditActiveRowAfter();return!1};
AdfDhtmlTableBasePeer.prototype._copyCellWidths=function(a,b){AdfAssert.assert(null!=a,"Unable to copy cell widths if the given source row is invalid!");AdfAssert.assert(null!=b,"Unable to copy cell widths if the target row is invalid!");for(var d=null,e=null,f=a.cells,g=b.cells,h=f.length,k=0;k<h;k++)d=f[k],e=g[k],e.style.width=d.style.width;if(0<=this._lastFrozen){var l=this._getNestedScrolledTable(a),m=this._getNestedScrolledTable(b);if(this._processColGroup()&&(f=AdfDhtmlTableBasePeer.FindFirstChildByTagName(l,
"COLGROUP"),d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(m,"COLGROUP"),f&&d))for(f=f.childNodes,g=d.childNodes,h=f.length,k=0;k<h;k++)d=f[k],e=g[k],"COL"==d.tagName&&"COL"==e.tagName&&(e.style.width=d.style.width);f=l.rows[0].cells;g=m.rows[0].cells;h=f.length;for(k=0;k<h;k++)d=f[k],e=g[k],e.style.width=d.style.width}};
AdfDhtmlTableBasePeer.prototype._replaceRowByKey=function(a,b,d){var e=AdfAgent.AGENT;if(a=this.FindRowByKey(a)){var f=a.tr;a=a.block;var g=a.cachedHeight;this._copyCellWidths(f,b);this._unregisterNode(f);f.parentNode.replaceChild(b,f);e.elementsAdded(b);d&&(f=b.nextSibling,e.getAttribute(f,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)&&(this._unregisterNode(f),f.parentNode.replaceChild(d,f),e.elementsAdded(d),d.cells[0].colSpan=b.cells.length));d=a.offsetHeight;a.cachedHeight=d;d-=g;for(e=a.nextSibling;e;)e.startPos+=
d,e=e.nextSibling;this._hasFrozenColumn()&&(cells=b.cells,b=this._freezeColumnsToEnd()?cells[0]:cells[cells.length-1],AdfDhtmlTableBasePeer.FindFirstChildByTagName(b,"DIV").onscroll=this._innerTableScrollCallback);this._adjustCanvasHeight(d,this.GetDataBody(),!0)}};
AdfDhtmlTableBasePeer.prototype._handleClickToEditActiveRowAfter=function(){this._stretchTheColumns();var a=this._currentScrollLeft;0!=a&&this._handleHorizontalScroll(a);this._processClickToEditRequestTimerId=AdfPage.PAGE.scheduleTimer(this,this._processClickToEditRequest,!0,10)};AdfDhtmlTableBasePeer.prototype.SetFirst=function(a){this.getComponent().setProperty("first",a,!1,AdfUIComponent.PROPAGATE_ALWAYS)};AdfDhtmlTableBasePeer.prototype.SetRows=function(a){this.getComponent().setRows(a)};
AdfDhtmlTableBasePeer.prototype.UpdateRange=function(a){var b=this.getComponent();AdfPage.PAGE.unmapDescendantComponentAbsoluteLocators(b);if(!this._isPaged){var d=this.GetDataBody().childNodes;if(0!=d.length){var e=d[0].startRow,d=d[d.length-1],d=d.startRow+d.numRows-e;this.SetFirst(e);this.SetRows(d);e=this.GetFirstVisibleRowKeyAndRow();null==e.rowKey||a||b.setProperty("scrollTopRowKey",e.rowKey,!0,AdfUIComponent.PROPAGATE_ALWAYS)}}};
AdfDhtmlTableBasePeer.prototype._checkStart=function(a){a=a.childNodes;if(!(1>a.length)){var b=a[0],d=b.startPos;if(0>d)for(this._setScrollTop(this._currentScrollTop-b.startPos),b=0;b<a.length;b++)a[b].startPos-=d}};
AdfDhtmlTableBasePeer.prototype._checkEnd=function(a){var b=a.childNodes;if(!(1>b.length)){var d=b[b.length-1],d=d.startPos+d.cachedHeight-this._canvasHeight;if(-1==this.GetRowCount()||this._canvasHeightLimited&&0>d)d+=AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE,this._canvasHeightLimited&&0>d&&(d=0);if(0<d){this._setScrollTop(this._currentScrollTop-d);for(var e=0;e<b.length;e++)b[e].startPos-=d}-1==this.GetRowCount()&&(a=this._canvasHeight-a.offsetHeight-AdfDhtmlTableBasePeer._FETCH_MORE_CANVAS_SPACE,
this._currentScrollTop>a&&this._setScrollTop(a))}};
AdfDhtmlTableBasePeer.prototype._processSelectionRequest=function(){var a=this._selectionRequest,b=null;if(null!=a){if(a==AdfDhtmlTableBasePeer._SELECT_PAGE_UP)b=this.GetFirstVisibleRowKeyAndRow();else if(a==AdfDhtmlTableBasePeer._SELECT_PAGE_DOWN)b=this._getLastVisibleRowKeyAndRow();else if(a==AdfDhtmlTableBasePeer._SELECT_ARROW_DOWN||a==AdfDhtmlTableBasePeer._FOCUS_RH_ARROW_DOWN||a==AdfDhtmlTableBasePeer._FOCUS_ROW_ARROW_DOWN)b=this._getNextRowKeyAndRow(this._lastRowKeyInView);else if(a==AdfDhtmlTableBasePeer._SELECT_ARROW_UP||
a==AdfDhtmlTableBasePeer._FOCUS_RH_ARROW_UP||a==AdfDhtmlTableBasePeer._FOCUS_ROW_ARROW_UP)b=this._getPreviousRowKeyAndRow(this._lastRowKeyInView);var d=b.rowKey,b=b.row;null!=d&&(a==AdfDhtmlTableBasePeer._FOCUS_RH_ARROW_UP||a==AdfDhtmlTableBasePeer._FOCUS_RH_ARROW_DOWN?(a=this.GetRowHeaderCellFromRow(b),this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,d,a)):(a!=AdfDhtmlTableBasePeer._FOCUS_ROW_ARROW_UP&&a!=AdfDhtmlTableBasePeer._FOCUS_ROW_ARROW_DOWN&&this._selSelectRow(d,b),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,
d,b)),this._unclipRow(b));delete this._selectionRequest}};
AdfDhtmlTableBasePeer.prototype.DisplayStatus=function(a,b){var d=this._getStatusMessage();if(d){d.innerHTML=a;var e=d.style;if("none"==e.display){e.zIndex=5E3;var f=this.GetDataBody();e.visibility="hidden";e.display="block";var g;g=this._virtInitialized?f.offsetHeight:this.getDomElement().clientHeight-this._cachedCHHeight;e.top=this._cachedCHHeight+Math.floor((g-d.offsetHeight)/2)+"px";g="25px";b&&(g=Math.floor(f.offsetWidth/2-d.offsetWidth/2)+"px");AdfDhtmlTableBasePeer._isRTL()?e.left=g:e.right=
g;e.visibility="visible"}}};AdfDhtmlTableBasePeer.prototype._hideStatus=function(){var a=this._getStatusMessage();a&&this._hideElement(a)};
AdfDhtmlTableBasePeer.prototype._hideElement=function(a){var b=AdfAgent.AGENT,d=this.GetScroller(),e=this._hasScroller(d)&&b.getPlatform()==AdfAgent.IE_PLATFORM&&8<=b.getVersion(),f;if(e)if(AdfCollections.isArray(d)){f=[];for(var g=0;g<d.length;g++)f[g]={x:b.getScrollLeft(d[g]),y:d[g].scrollTop}}else f={x:b.getScrollLeft(d),y:d.scrollTop};a.style.display="none";if(e)if(AdfCollections.isArray(d))for(g=0;g<d.length;g++)b.setScrollLeft(d[g],f[g].x),d[g].scrollTop=f[g].y;else b.setScrollLeft(d,f.x),d.scrollTop=
f.y};AdfDhtmlTableBasePeer.prototype._hasScroller=function(a){if(AdfCollections.isArray(a)){for(var b=0;b<a.length;b++)if(null!=a[b])return!0;return!1}return null!=a};AdfDhtmlTableBasePeer.prototype.GetDataBody=function(a){if(this._dataBodyWrapped){a=this.__getElemBySubId(AdfDhtmlTableBasePeer._DATAWRAPPER,a).childNodes;for(var b=0;b<a.length;b++)if(null!=a[b].id&&0<a[b].id.indexOf("db"))return a[b];return null}return this.__getElemBySubId("db",a)};
AdfDhtmlTableBasePeer.prototype._getStatusMessage=function(){return this.__getElemBySubId("sm")};AdfDhtmlTableBasePeer.prototype._getColumnResizeIndicator=function(){return this.__getElemBySubId("ri")};AdfDhtmlTableBasePeer.prototype.__getColumnHeader=function(){return this.__getElemBySubId("ch")};AdfDhtmlTableBasePeer.prototype._getColumnFooter=function(){return this.__getElemBySubId("cf")};AdfDhtmlTableBasePeer.prototype._getNavigationBar=function(){return this.__getElemBySubId("nbar")};
AdfDhtmlTableBasePeer.prototype._getLoadMore=function(a){var b=this.getDomElement();if(this._dataBodyWrapped){var d=this.getDomElement();(d=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(d.id,AdfDhtmlTableBasePeer._DATAWRAPPER)))&&1<d.childNodes.length&&(b=d)}b=b.childNodes;for(d=0;d<b.length;d++)if(null!=b[d].id&&0<b[d].id.indexOf(a?AdfDhtmlTableBasePeer._LOAD_MORE_TOP_DIV:AdfDhtmlTableBasePeer._LOAD_MORE_BOTTOM_DIV))return b[d];return null};
AdfDhtmlTableBasePeer.prototype._setFakeCanvasWidth=function(a){var b=this.GetScroller();if(this._hasSingleScroller()&&!this._isPaged)AdfDhtmlTableBasePeer.FindFirstChildByTagName(b,"DIV").style.width=a+"px";else{var d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(b[0],"DIV");AdfDhtmlTableBasePeer.FindFirstChildByTagName(b[1],"DIV").style.width=d.style.width=a+"px"}};
AdfDhtmlTableBasePeer.prototype._setFakeCanvasHeight=function(a){var b=this.GetScroller();a>AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT?(a=AdfDhtmlTableBasePeer._CSS_HEIGHT_LIMIT,this._canvasHeightLimited=!0):this._canvasHeightLimited=!1;if(this._hasSingleScroller()&&!this._isPaged){var d=b.scrollTop;AdfDhtmlTableBasePeer.FindFirstChildByTagName(b,"DIV").style.height=a+"px";b.scrollTop=d}else d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(b[0],"DIV"),AdfDhtmlTableBasePeer.FindFirstChildByTagName(b[1],
"DIV").style.height=d.style.height=a+"px"};AdfDhtmlTableBasePeer.prototype.GetScroller=function(){if(this._hasSingleScroller()&&!this._isPaged)return this.__getElemBySubId("scroller");var a=[];a[AdfDhtmlTableBasePeer._HSCROLLER]=this.__getElemBySubId("hscroller");a[AdfDhtmlTableBasePeer._VSCROLLER]=this.__getElemBySubId("vscroller");return a};
AdfDhtmlTableBasePeer.prototype._scrollerScrollToPos=function(a,b){var d=AdfAgent.getAgent(),e=null!=a&&AdfDhtmlTableBasePeer._isRTL()&&d.getPlatform()==AdfAgent.IE_PLATFORM&&7<d.getVersion();if(this._hasSingleScroller()&&!this._isPaged){var f=this.GetScroller();e&&(a=f.scrollWidth-f.clientWidth-a);d.scrollToPos(f,a,b)}else{var f=this.GetScroller(),g=f[AdfDhtmlTableBasePeer._HSCROLLER];e&&(a=g.scrollWidth-g.clientWidth-a);d.scrollToPos(f[AdfDhtmlTableBasePeer._HSCROLLER],a,b);d.scrollToPos(f[AdfDhtmlTableBasePeer._VSCROLLER],
a,b)}};AdfDhtmlTableBasePeer.prototype.__getScrollerDimensions=function(){return{offsetWidth:this._getScrollerOffsetWidth(),offsetHeight:this._getScrollerOffsetHeight(),clientWidth:this._getScrollerClientWidth(),clientHeight:this._getScrollerClientHeight()}};AdfDhtmlTableBasePeer.prototype._getScrollerOffsetWidth=function(){return this._hasSingleScroller()&&!this._isPaged?this.GetScroller().offsetWidth:this.GetScroller()[0].offsetWidth};
AdfDhtmlTableBasePeer.prototype._getScrollerOffsetHeight=function(){return this._hasSingleScroller()&&!this._isPaged?this.GetScroller().offsetHeight:this.GetScroller()[1].offsetHeight};AdfDhtmlTableBasePeer.prototype._getScrollerClientWidth=function(){return this._hasSingleScroller()&&!this._isPaged?this.GetScroller().clientWidth:this.GetScroller()[0].clientWidth};
AdfDhtmlTableBasePeer.prototype._getScrollerClientHeight=function(){return this._hasSingleScroller()&&!this._isPaged?this.GetScroller().clientHeight:this.GetScroller()[1].clientHeight};AdfDhtmlTableBasePeer.prototype._getVerticalScrollBarWidth=function(){var a=this.GetScroller();return this._footerless&&!this._isPaged?a.offsetWidth-a.clientWidth:a[1].offsetWidth-a[1].clientWidth};
AdfDhtmlTableBasePeer.prototype._setScrollerTop=function(a){if(this._hasSingleScroller()&&!this._isPaged)this.GetScroller().style.top=a+"px";else{var b=this.GetScroller();b[0].style.top=b[1].style.top=a+"px"}};
AdfDhtmlTableBasePeer.prototype._setScrollerHeight=function(a,b,d,e){if(this._hasSingleScroller()&&!this._isPaged){var f=Math.max(0,a-b-e);this.GetScroller().style.height=f+"px"}else{var g=this.GetScroller(),f=Math.max(0,a-b);g[0].style.height=f+"px";f=Math.max(0,a-b-d-e-(g[0].offsetHeight-g[0].clientHeight));g[1].style.height=f+"px"}};
AdfDhtmlTableBasePeer.prototype._setScrollerWidth=function(a,b){if(this._hasSingleScroller()&&!this._isPaged){var d=Math.max(a-b,0),e=this.GetScroller().style;e.overflowX="auto";e.width=d+"px"}else{var f=this.GetScroller(),d=Math.max(a-b,0);f[1].style.overflowX="hidden";f[1].style.width=d+"px";e=0;0<f[1].clientWidth&&(e=f[1].offsetWidth-f[1].clientWidth);d=Math.max(a-b-e,0);f=f[0].style;f.overflowX="auto";f.width=d+"px";this._freezeColumnsToEnd()||(AdfDhtmlTableBasePeer._isRTL()?f.left=e+"px":f.right=
e+"px")}};AdfDhtmlTableBasePeer.prototype._setScrollLeft=function(a){var b=AdfAgent.AGENT;this._currentScrollLeft=a;if(this._hasSingleScroller()&&!this._isPaged){var d=this.GetScroller();b.getScrollLeft(d)!=a&&b.setScrollLeft(d,a)}else d=this.GetScroller(),b.getScrollLeft(d[0])!=a&&b.setScrollLeft(d[0],a)};
AdfDhtmlTableBasePeer.prototype.__getScrollLeft=function(){var a=AdfAgent.AGENT;if(this._hasSingleScroller()&&!this._isPaged)a=a.getScrollLeft(this.GetScroller());else var b=this.GetScroller(),a=a.getScrollLeft(b[0]);return Math.round(a)};AdfDhtmlTableBasePeer.prototype.__getCurrentScrollLeft=function(){return this._currentScrollLeft};
AdfDhtmlTableBasePeer.prototype._setScrollTop=function(a){this._currentScrollTop=a;if(this._hasSingleScroller()&&!this._isPaged){var b=this.GetScroller();b.scrollTop!=a&&(b.scrollTop=a)}else b=this.GetScroller(),b[1].scrollTop!=a&&(b[1].scrollTop=a);this._isTouch&&"Windows"!=AdfAgent.guessOS()||AdfAgent.AGENT.getPlatform()!=AdfAgent.WEBKIT_PLATFORM||(this._scrollTopUpdating=!0,setTimeout(AdfDhtmlTableBasePeer._resetScrollTopUpdating,100,this))};
AdfDhtmlTableBasePeer.prototype.__getScrollDimensions=function(){return{scrollLeft:this.__getScrollLeft(),scrollTop:this._getScrollTop(),scrollHeight:this._getScrollHeight(),scrollWidth:this._getScrollWidth()}};AdfDhtmlTableBasePeer.prototype._getScrollTop=function(){var a;if(this._hasSingleScroller()&&!this._isPaged)a=this.GetScroller().scrollTop;else{a=this.GetScroller();var b=AdfAgent.AGENT;a=this._isTouch&&b.getPlatform()==AdfAgent.WEBKIT_PLATFORM&&b.getOS()==AdfAgent.MAC_OS?a[0].scrollTop:a[1].scrollTop}return a};
AdfDhtmlTableBasePeer.prototype._getScrollHeight=function(){return this._hasSingleScroller()&&!this._isPaged?this.GetScroller().scrollHeight:this.GetScroller()[1].scrollHeight};AdfDhtmlTableBasePeer.prototype._getScrollWidth=function(){var a=this.GetScroller();if(a)return this._hasSingleScroller()&&!this._isPaged?a.scrollWidth:a[0].scrollWidth};AdfDhtmlTableBasePeer.prototype.__getLastFrozen=function(){return this._lastFrozen};AdfDhtmlTableBasePeer.prototype.__getFirstFrozen=function(){return this._firstFrozen};
AdfDhtmlTableBasePeer.prototype.__getElemBySubId=function(a,b){var d=this.getDomElement();null==d&&(d=b);return AdfDhtmlTableBasePeer.__getChildBySubId(d,a)};AdfDhtmlTableBasePeer.__getChildBySubId=function(a,b){AdfAssert.assert(null!=a,"Table peer cannot get a child by sub ID if the parent is null!");for(var d=a.id+"::"+b,e=a.childNodes,f=0;f<e.length;f++)if(d==e[f].id)return e[f];return null};AdfDhtmlTableBasePeer.prototype.GetRowCount=function(){return this._rowCount};
AdfDhtmlTableBasePeer.prototype.GetKnownRowCount=function(){return this._knownRowCount};AdfDhtmlTableBasePeer.prototype.getClientStartRowIndex=function(){var a=this.GetDataBody();return a&&a.childNodes&&0<a.childNodes.length?a.childNodes[0].startRow:-1};AdfDhtmlTableBasePeer.prototype.getClientRowCount=function(){var a=0,b=this.GetDataBody();if(b&&b.childNodes)for(var d=0;d<b.childNodes.length;d++)a+=b.childNodes[d].numRows;return a};
AdfDhtmlTableBasePeer.prototype.simulateSelectRows=function(a,b){for(var d,e,f,g="toggle"==b,h=a.split(","),k=0;k<h.length;k++)if(e=h[k],d=this.FindRowByKey(e))if(f=this.FindCellByIndex(d.tr,0))this._handleRowMouseDown(null,f,!0,g,!1,e,d.tr),this._handleRowClick(f,!0,g,!1,e,d.tr),g=!0};
AdfDhtmlTableBasePeer.prototype._syncRowHeight=function(a,b){var d=this._getNestedScrolledTable(a);if(d.offsetHeight!=b){var e=AdfAgent.AGENT,f=e.getPlatform()==AdfAgent.IE_PLATFORM,e=e.getPlatform()==AdfAgent.WEBKIT_PLATFORM;f||e?d.style.height="auto":d.rows[0].style.height="auto";f||e?d.style.height=b+"px":d.rows[0].style.height=b+"px"}};
AdfDhtmlTableBasePeer.prototype._synchronizeRowHeights=function(a){if(this._hasFrozenColumn()){var b=a.startPos,d=a._lastSyncRow,e=this._dataBodyHeight,f=a.rows,g=f.length,h=this._currentScrollTop;if(!(null!=d&&d==g-1||b>h+e||this._areAllColumnsFrozen(f[0].cells.length))){for(var k=0;k<g;k++)if(!(null!=d&&d>=k)){var l=f[k],m=l.offsetHeight;this._syncRowHeight(l,m);if(b+l.offsetTop+m>h+e){a._lastSyncRow=k;return}}a._lastSyncRow=g-1}}};
AdfDhtmlTableBasePeer.prototype._showColumnResizeIndicator=function(a,b){var d=this._getColumnResizeIndicator();if(d){var e=!AdfDhtmlTableBasePeer._isRTL(),d=d.style;d.display="block";d.zIndex=20;d.top="0px";if(e)e=a.offsetLeft+a.offsetWidth,this._freezeColumnsToStart()&&!this._isColumnFrozen(b)?e+=this._frozenWidth:this._freezeColumnsToEnd()&&this._isColumnFrozen(b)&&(e+=this._getUnfrozenColumnsWidth()),this._hasFrozenColumn()&&this._isColumnFrozen(b)||(e-=this._currentScrollLeft);else if(e=a.offsetLeft,
this._freezeColumnsToStart()&&this._isColumnFrozen(b))e+=this.getDomElement().offsetWidth-a.parentNode.parentNode.offsetWidth;else if(this._freezeColumnsToEnd()&&!this._isColumnFrozen(b))e+=this._frozenWidth;else{for(var f=a.parentNode;f&&"TABLE"!=f.tagName;)f=f.parentNode;if(f&&"TABLE"==f.tagName){for(var g=f.offsetWidth,h=f.offsetLeft;f&&"DIV"!=f.tagName;)f=f.parentNode;f&&"DIV"==f.tagName&&f.offsetWidth>g&&(e+=h)}e-=this._getRTLScrollAdjustment();this._getScrollHeight()>this._getScrollerOffsetHeight()&&
(e+=this._getVerticalScrollBarWidth())}d.left=e+"px";d.height=this._cachedCHHeight+this._cachedCFHeight+this._cachedNBHeight+this._cachedFMHeight+this.GetDataBody().offsetHeight+"px"}};
AdfDhtmlTableBasePeer.prototype._getColumnHeaderFooterSizingCell=function(a,b,d,e,f){if(!this._hasFrozenColumn()||this._isColumnFrozen(a))return f=AdfDhtmlTableBasePeer.__getChildBySubId(b,d),this._freezeColumnsToEnd()?f.rows[0].cells[a-this._firstFrozen]:f.rows[0].cells[a];b=AdfDhtmlTableBasePeer.__getChildBySubId(b,e);f=AdfDhtmlTableBasePeer.__getChildBySubId(b,f);return this._freezeColumnsToStart()?f.rows[0].cells[a-this._lastFrozen-1]:f.rows[0].cells[a]};
AdfDhtmlTableBasePeer.prototype._getResizedCellInfo=function(a){var b=AdfAgent.AGENT,d=a.cell;AdfDhtmlTableBasePeer._isRTL();var e=b.getIntAttribute(d,"_d_index",-1);"start"==a.data?e--:e+=b.getIntAttribute(d,"colspan",1)-1;a=this._getColumnHeaderFooterSizingCell(e,this.__getColumnHeader(),"t","d2","t2");return b.getAttribute(a,AdfDhtmlTableBasePeer.NO_RESIZE_MARKER,!1)?null:{cell:a,displayIndex:e}};
AdfDhtmlTableBasePeer.prototype._getColumnHeaderLeafCell=function(a){var b=this.__getColumnHeader();if(!b)return null;var d=AdfDhtmlTableBasePeer.__getChildBySubId(b,"t"),e=Array(d);this._hasFrozenColumn()&&(b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"d2"),b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"t2"),e.push(b));for(var b=AdfAgent.AGENT,f=AdfDhtmlTableBasePeer._LEAF_COLUMN,g=null,d=d.rows.length-1;0<=d&&!g;d--)for(var h=0;h<e.length;h++)for(var k=e[h].rows[d].cells,l=0;l<k.length&&!g;l++){var m=
k[l];if(m.getAttribute(f)&&b.getIntAttribute(m,"_d_index",-1)==a){g=m;break}}return g};
AdfDhtmlTableBasePeer.prototype._synchronizeColumnRowHeights=function(a,b,d,e){if(this._hasFrozenColumn()){var f=AdfAgent.AGENT,g=f.getPlatform()==AdfAgent.WEBKIT_PLATFORM,h=f.getPlatform()==AdfAgent.IE_PLATFORM&&8==f.getVersion();b=AdfDhtmlTableBasePeer.__getChildBySubId(a,b);a=AdfDhtmlTableBasePeer.__getChildBySubId(a,d);e=AdfDhtmlTableBasePeer.__getChildBySubId(a,e);a=b.rows;d=e.rows;b.style.height=e.style.height="auto";for(var k=0;k<a.length;k++)a[k].style.height=d[k].style.height="auto";for(k=
0;k<a.length;k++)if(h){for(var l=-1,m=0;m<a[k].cells.length;m++)if(a[k].cells[m].rowSpan&&1==a[k].cells[m].rowSpan){l=m;break}for(var m=-1,n=0;n<d[k].cells.length;n++)if(d[k].cells[n].rowSpan&&1==d[k].cells[n].rowSpan){m=n;break}var q=n=0;-1<l&&(n=a[k].cells[l].offsetHeight);-1<m&&(q=d[k].cells[m].offsetHeight);n>q?f.setTableRowHeight(d[k],n):q>n&&f.setTableRowHeight(a[k],q)}else l=a[k].offsetHeight,m=d[k].offsetHeight,l>m?f.setTableRowHeight(d[k],l):m>l&&f.setTableRowHeight(a[k],m);e.style.height=
b.style.height=Math.max(b.offsetHeight,e.offsetHeight)+"px";if(g&&2==d.length){for(k=0;k<d[0].cells.length;k++)d[1].cells[k].rowSpan="10";for(k=0;k<a[0].cells.length;k++)a[1].cells[k].rowSpan="10"}}};AdfDhtmlTableBasePeer.prototype._getInnerTableCell=function(a,b){var d=this._getNestedScrolledTable(a).rows[0];return this._freezeColumnsToStart()?d.cells[b-this._lastFrozen-1]:d.cells[b]};
AdfDhtmlTableBasePeer._handleMouseWheel=function(a){a||(a=AdfPage.PAGE.getDomWindow().event);var b=AdfDhtmlTableBasePeer.__getChildBySubId(this.parentNode,"scroller"),d=AdfDhtmlTableBasePeer.__getChildBySubId(this.parentNode,"hscroller");b||(b=AdfDhtmlTableBasePeer.__getChildBySubId(this.parentNode,"vscroller"));if(b){var e=AdfAgent.AGENT,f=null,g=null,h=a.deltaX,k=a.deltaY,l=a.wheelDeltaX,m=a.wheelDeltaY,n=a.deltaMode;null!=h||null!=k?(e=e.getPlatform()==AdfAgent.IE_PLATFORM?40:1,null!=h&&(f=h/e),
null!=k&&(g=k*(1==n?33:1))):(null!=l&&(f=-l/4),null!=m&&(g=-m/4),null==l&&null==m&&(g=null==a.wheelDelta?4*a.detail:-a.wheelDelta/4));null!=g&&0!=g&&(b.scrollTop+=Math.round(g),h=b.offsetHeight,k=b.scrollHeight,n=b.scrollTop,(0<g&&k-n>h||0>g&&0<n)&&AdfAgent.AGENT.eatEvent(a));null!=f&&0!=f&&(b.scrollLeft+=Math.round(f),d&&(d.scrollLeft+=Math.round(f)),AdfAgent.AGENT.eatEvent(a))}};
AdfDhtmlTableBasePeer.prototype._positionInnerTable=function(a,b){var d=AdfAgent.AGENT,e=a.rows;AdfDhtmlTableBasePeer._isRTL();for(var f=this._freezeColumnsToEnd(),g=0;g<e.length;g++){var h=e[g].cells;(h=AdfDhtmlTableBasePeer.FindFirstChildByTagName(f?h[0]:h[h.length-1],"DIV"))&&d.setScrollLeft(h,b)}};AdfDhtmlTableBasePeer._scrollColumnHeader=function(a,b){var d=AdfDhtmlTableBasePeer.__getChildBySubId(a,"d2");AdfAgent.AGENT.setScrollLeft(d,b)};
AdfDhtmlTableBasePeer._scrollColumnFooter=function(a,b){var d=AdfDhtmlTableBasePeer.__getChildBySubId(a,"fd2");AdfAgent.AGENT.setScrollLeft(d,b)};AdfDhtmlTableBasePeer.FindFirstChildByTagName=function(a,b){AdfAssert.assert(null!=a,"Table peer cannot find first child by tag name if the parent is null!");for(var d=a.childNodes,e=0;e<d.length;e++)if(b==d[e].tagName)return d[e];return null};
AdfDhtmlTableBasePeer._findFirstLevelChildrenByTagName=function(a,b){AdfAssert.assert(null!=a,"Table peer cannot find first level children by tag name if the parent is null!");for(var d=[],e=a.childNodes,f=0;f<e.length;f++)b==e[f].tagName&&d.push(e[f]);return d};
AdfDhtmlTableBasePeer.prototype.GetRowKeyAndRow=function(a,b){AdfAssert.assertDomElement(a);var d=a,e=AdfAgent.AGENT;if(null==d||1!=d.nodeType)return null;for(var f=e.getAttribute(d,AdfDhtmlTableBasePeer._ROW_KEY);null==f;){if(null==d||d==b)return null;d=d.parentNode;if(!this._isClickToEdit()&&this._hasDetailStamp&&"TR"==e.getNodeName(d)&&e.getAttribute(d,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)&&(f=e.getAttribute(d.previousSibling,AdfDhtmlTableBasePeer._ROW_KEY),null!=f))break;if(null==d||1!=
d.nodeType)return null;f=e.getAttribute(d,AdfDhtmlTableBasePeer._ROW_KEY)}return[f,d]};
AdfDhtmlTableBasePeer.prototype._hideDragColumnFooter=function(a,b){var d=this._lastFrozen,e=this._firstFrozen,f=this._reorderColWidth,g=this._reorderHiddenCells,h=this._getColumnFooter(),k=null;this._hasFrozenColumn()&&!this._isColumnFrozen(a)?(k=AdfDhtmlTableBasePeer.__getChildBySubId(h,"fd2"),h=AdfDhtmlTableBasePeer.__getChildBySubId(k,"ft2")):h=AdfDhtmlTableBasePeer.__getChildBySubId(h,"ft");for(var l=0;2>l;l++){var m=h.rows[l].cells,n;n=this._freezeColumnsToStart()&&!this._isColumnFrozen(a)?
a-d-1:this._freezeColumnsToEnd()&&this._isColumnFrozen(a)?a-e:a;for(var q=0;q<b;q++){var r=m[n++];g.push(r);r._afrIsFooter=!0;r.style.display="none"}}this._processColGroup()&&this._hideReorderColGroupCols(h,a,b);this._adjustReorderColumnHeaderWidths(h,k,a,f)};
AdfDhtmlTableBasePeer.prototype._adjustReorderColumnHeaderWidths=function(a,b,d,e){var f=a.style;f.width=parseInt(f.width)-e+"px";this._hasFrozenColumn()&&(this._freezeColumnsToStart()?this._isColumnFrozen(d)?(f=a.nextSibling.style,AdfDhtmlTableBasePeer._isRTL()?f.right=parseInt(f.right)-e+"px":f.left=parseInt(f.left)-e+"px"):(f=b.style,f.width=parseInt(f.width)-e+"px"):(f=a.nextSibling?a.nextSibling.style:a.parentNode.nextSibling.style,this._isColumnFrozen(d)||(AdfDhtmlTableBasePeer._isRTL()?f.right=
parseInt(f.right)-e+"px":f.left=parseInt(f.left)-e+"px",f=b.style),f.width=parseInt(f.width)-e+"px"))};AdfDhtmlTableBasePeer.prototype._adjustReorderColumnFooterWidths=function(a,b){var d=this._getColumnFooter(),e=null;this._hasFrozenColumn()&&!this._isColumnFrozen(a)?(e=AdfDhtmlTableBasePeer.__getChildBySubId(d,"fd2"),d=AdfDhtmlTableBasePeer.__getChildBySubId(e,"ft2")):d=AdfDhtmlTableBasePeer.__getChildBySubId(d,"ft");this._adjustReorderColumnHeaderWidths(d,e,a,b)};
AdfDhtmlTableBasePeer.prototype._adjustReorderInnerTableWidth=function(a,b){var d=a.style,e=parseInt(d.width)-b;0<e&&(d.width=e+"px");d=a.parentNode.parentNode.style;e=d.width;""!=e&&(e=parseInt(e)-b,0<e&&(d.width=e+"px"))};
AdfDhtmlTableBasePeer.prototype._hideReorderColGroupCols=function(a,b,d,e){var f=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"COLGROUP"),g=this._firstFrozen,h=this._lastFrozen;if(f){a=this._reorderHiddenCells;var f=f.getElementsByTagName("col"),k=b;this._freezeColumnsToStart()&&!this._isColumnFrozen(b)?k=b-h-1:this._freezeColumnsToEnd()&&this._isColumnFrozen(b)&&(k=e?b-g+1:b-g);for(i=k;i<k+d;i++)i<f.length&&(b=f[i],b._afrOriginalWidth=b.style.width,b.style.width="0px",b.style.display="none",a.push(b))}};
AdfDhtmlTableBasePeer.prototype._adjustReorderNonFrozenCol=function(a,b){var d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"COLGROUP");if(d){var d=d.getElementsByTagName("col"),e=null,e=this._freezeColumnsToEnd()?d[0]:d[d.length-1];e.style.width=parseInt(e.style.width)-b+"px"}};AdfDhtmlTableBasePeer.prototype._adjustReorderDataBodyNonFrozenCol=function(a){var b=this.GetDataBody().childNodes,d=b.length;for(i=0;i<d;i++)this._adjustReorderNonFrozenCol(b[i],a)};
AdfDhtmlTableBasePeer.prototype._insertEmptyDropColGroupCol=function(a,b,d,e,f,g,h){a=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"COLGROUP");var k=this._firstFrozen,l=this._lastFrozen;if(a){var m=a.getElementsByTagName("col"),n=b;this._freezeColumnsToStart()&&!this._isColumnFrozen(b)?n=b-l-1:this._freezeColumnsToEnd()&&this._isColumnFrozen(b)&&(n=h?b-k+1:b-k);e&&(n+=d-1);b=m[n];d=a.ownerDocument.createElement("col");e?b.nextSibling?a.insertBefore(d,b.nextSibling):a.appendChild(d):a.insertBefore(d,
b);d.style.width=f+"px";g.push(d);a.span++}};AdfDhtmlTableBasePeer.prototype._forceRelayoutDataBody=function(){var a=this.GetDataBody().childNodes,b=a.length,d=this._currentScrollLeft;for(i=0;i<b;i++){var e=a[i].rows[0],f=e.style;f.display="block";f.display="";this._hasFrozenColumn()&&(innerTable=this._getNestedScrolledTable(e),AdfAgent.AGENT.setScrollLeft(innerTable.parentNode,d))}};
AdfDhtmlTableBasePeer.prototype._processColumnReorderAction=function(a){var b=AdfAgent.AGENT,d=this._reorderTH;d&&(this._columnReorderTracker=this._createReorderTracker(),this._positionColumnReorderTracker(a),this._insertEmptyDropColumn(a),this._colReorderDragCallback||(this._colReorderDragCallback=this.createCallback(this._handleColReorderDrag),this._colReorderDropCallback=this.createCallback(this._handleColReorderDrop),this._colReorderAbortCallback=this.createCallback(this._handleColReorderAbort)),
b.disableUserSelect(this.__getColumnHeader()),AdfPage.PAGE.startDrag(a,this._colReorderDragCallback,this._colReorderDropCallback,this._colReorderAbortCallback),b.setCursor(d,"move",!0),b.setCursor(this.getDomElement(),"move",!0),b.eatEvent(a))};
AdfDhtmlTableBasePeer.prototype._positionColumnReorderTracker=function(a){var b=this._columnReorderTracker,d=b.style,e=this.getDomElement(),f=AdfAgent.AGENT;a=f.getMousePosition(a);e=f.getElementPosition(e);b=Math.max(a.x-e.x+(AdfDhtmlTableBasePeer._isRTL()?-b.offsetWidth+8:-8),0);a=Math.max(a.y-e.y-8,0);d.left=b+"px";d.top=a+"px"};
AdfDhtmlTableBasePeer.prototype._autoScrollColumnsIfNecessary=function(a){var b=this.getDomElement();if(!(this._getScrollWidth()<=this._getScrollerOffsetWidth())){var d=AdfAgent.getAgent();a=d.getMousePosition(a);var b=d.getElementPosition(b),b=Math.max(a.x-b.x,0),d=this.__getColumnHeader(),e,f=AdfDhtmlTableBasePeer.__getChildBySubId(d,"t");this._hasFrozenColumn()?(e=AdfDhtmlTableBasePeer.__getChildBySubId(d,"d2"),d=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t2")):d=f;a=0;var g=AdfDhtmlTableBasePeer._isRTL()?
this._getRTLScrollAdjustment():this._currentScrollLeft,h=!1,k=!1;if(!e||b>f.offsetWidth)e&&(a=f.offsetWidth),b-a<AdfDhtmlTableBasePeer._AUTOSCROLL_MARGIN&&0<g?h=!0:b-a>this._getScrollerClientWidth()-AdfDhtmlTableBasePeer._AUTOSCROLL_MARGIN&&(k=!0);if(h||k)for(a-=g,e=AdfDhtmlTableBasePeer._ROOT_COLUMN,k=AdfDhtmlTableBasePeer._ROW_HEADER,f=f.rows.length-1;0<=f;f--)for(var l=d.rows[f].cells,m=l.length,n=0;n<m;n++){var q=l[n];if(q.getAttribute(e)&&null==q.getAttribute(k)){var r=q.offsetLeft+a,t=r+q.offsetWidth;
if(b>=r&&b<=t){g=h?Math.max(g-q.offsetWidth,0):Math.min(g+q.offsetWidth,this._getScrollWidth()-this._getScrollerClientWidth());this._scrollerScrollToPos(g,null);break}}}}};AdfDhtmlTableBasePeer.prototype._handleColReorderDrag=function(a,b,d){this._autoScrollColumnsIfNecessary(a);this._positionColumnReorderTracker(a);this._insertEmptyDropColumn(a)};
AdfDhtmlTableBasePeer.prototype._handleColReorderDrop=function(a,b,d){a=null;null!=this._targetReorderTH&&(a=this._getColReorderAnimationDuration(),this._reorderId=this._reorderTH.id,0<a?this._reorderColumnComponentsWithAnimation(a):this._reorderColumnComponentsWithoutAnimation());0==a&&(null!=this._columnReorderTracker&&(this.getDomElement().removeChild(this._columnReorderTracker),this._columnReorderTracker=null),this._cleanUpAfterColumnReorder());AdfAgent.AGENT.enableUserSelect(this.__getColumnHeader())};
AdfDhtmlTableBasePeer.prototype._getColReorderAnimationDuration=function(){var a=this._colReorderAnimationDuration;void 0==a&&(a=AdfPage.PAGE,this._colScrollAnimationDuration=a=a.isAnimationEnabled()?parseInt(a.getLookAndFeel().getSkinProperty("af|table-tr-column-reorder-animation-duration"),10):0);return a};
AdfDhtmlTableBasePeer.prototype._reorderColumnComponentsWithoutAnimation=function(){if(this._queueColumnReorderEvent().isCanceled())this._handleColReorderAbort();else{var a=AdfPage.PAGE.getLookAndFeel().getTranslatedString("af_table.LABEL_REORDERING_COLUMN");this.DisplayStatus(a,!0)}};
AdfDhtmlTableBasePeer.prototype._queueColumnReorderEvent=function(){var a=this.getComponent(),a=new AdfTableShowColumnsEvent(a,this._reorderId,"reorderColumn");a.setTargetColumnId(this._targetReorderTH.id);a.setAfterTarget(this._insertColumnAfter);a.queue();return a};
AdfDhtmlTableBasePeer.prototype._cleanUpAfterColumnReorder=function(){AdfAgent.AGENT.setCursor(this.getDomElement(),"");this._targetReorderTH=this._reorderTH=null;delete this._reorderId;delete this._reorderHiddenCells;delete this._insertColumnAfter;delete this._previousInsertColIndex;delete this._emptyDropCells;delete this._reorderEmptyCellWidth};
AdfDhtmlTableBasePeer.prototype._reorderColumnComponentsWithAnimation=function(a){var b=this._emptyDropCells[0].offsetLeft,b=b+this._reorderDropColumnExtraX;AdfDhtmlElementAnimator.animate(AdfDhtmlElementAnimator.FRAME_METHOD_SLOW_FAST_SLOW,a,[{element:this._columnReorderTracker,properties:{top:0,left:b}}],null,AdfDhtmlTableBasePeer._columnReorderAnimationComplete,this)};
AdfDhtmlTableBasePeer.prototype._createReorderTracker=function(){var a=AdfAgent.AGENT,b=this._reorderTH,d=a.getIntAttribute(b,"_d_index",-1),b=b.colSpan,e=this.getDomElement(),f=e.ownerDocument.createElement("div"),g=f.style;e.appendChild(f);g.overflow="hidden";g.position="absolute";g.zIndex=1E3;a.setOpacity(f,85);this._reorderHiddenCells=[];a=this._createReorderColumnLayerHeader(f,d,b);this._createReorderColumnLayerBody(f,a,d,b);this._footerless||this._hideDragColumnFooter(d,b);return f};
AdfDhtmlTableBasePeer.prototype._createReorderColumnLayerHeader=function(a,b,d){var e=AdfAgent.AGENT,f=this._lastFrozen,g=this._firstFrozen,h=this.__getColumnHeader(),k=null;this._hasFrozenColumn()&&!this._isColumnFrozen(b)?(k=AdfDhtmlTableBasePeer.__getChildBySubId(h,"d2"),h=AdfDhtmlTableBasePeer.__getChildBySubId(k,"t2")):h=AdfDhtmlTableBasePeer.__getChildBySubId(h,"t");var l=a.ownerDocument.createElement("table");l.className=h.className;l.cellSpacing=0;colTableStyle=l.style;colTableStyle.tableLayout=
"fixed";colTableStyle.position="relative";a.appendChild(l);for(var m=h.rows.length,n=0,q=this._reorderHiddenCells,r=0;r<m;r++)for(var t=h.rows[r].cells,u=t.length,v=null,w=0,y,z=0;z<u;z++){var B=t[z],C=!1;if(0<r){C=e.getIntAttribute(B,"_d_index",-1);if(C>b)break;C=C==b}else C=this._freezeColumnsToStart()&&!this._isColumnFrozen(b)?z==b-f-1:this._freezeColumnsToEnd()&&this._isColumnFrozen(b)?z==b-g:z==b;if(C){do null==v?(v=B,y=l.insertRow(r),0==r&&e.getPlatform()==AdfAgent.IE_PLATFORM&&8>e.getVersion()&&
(y.style.position="absolute")):v=t[++z],w+=v.colSpan,u=this._cloneWithSelectedOption(v,!0),e.removeIdsFromDomSubTree(u),y.appendChild(u),y.style.height="auto",0!=r?(u.rowSpan=1,e.setOuterHeight(u,v.offsetHeight)):n+=v.offsetWidth,q.push(v);while(w<d);break}}for(r=q.length-1;0<=r;r--)q[r].style.display="none";this._processColGroup()&&this._hideReorderColGroupCols(h,b,d);this._reorderColWidth=n;a.style.width=colTableStyle.width=n+"px";this._adjustReorderColumnHeaderWidths(h,k,b,n);e.setOuterHeight(l,
h.offsetHeight);return l};
AdfDhtmlTableBasePeer.prototype._createReorderColumnLayerBody=function(a,b,d,e){var f=AdfAgent.AGENT,g=f.getPlatform()==AdfAgent.GECKO_PLATFORM,h=this._lastFrozen,k=this._firstFrozen,l=this._reorderColWidth;b=this._cloneWithSelectedOption(b,!1);a.appendChild(b);a=this._reorderHiddenCells;for(var m=this.GetDataBody(),n=m.childNodes,q=n.length,r=this._currentScrollTop,t,u=0;u<q;u++){var v=n[u],w=v.rows,y=w.length,z=0;0==u&&(b.className=v.className,t=v.startPos);for(var B=0;B<y;B++){var C=w[B];if(C.offsetTop-
(r-t)>m.offsetHeight)break;var A,E,F=null;this._freezeColumnsToStart()&&!this._isColumnFrozen(d)?(F=this._getNestedScrolledTable(C),A=F.rows[0].cells,E=d-h-1):this._freezeColumnsToEnd()?this._isColumnFrozen(d)?(E=d-k+1,A=C.cells):(F=this._getNestedScrolledTable(C),A=F.rows[0].cells,E=d):(E=d,A=C.cells);if(!this._hasDetailStamp||!f.getAttribute(C,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)){var D=b.insertRow(z);z++;for(var J=0;J<e;J++){var G=A[E++];cellClone=this._cloneWithSelectedOption(G,!0);f.removeIdsFromDomSubTree(cellClone);
D.appendChild(cellClone);a.push(G);G.style.display="none";g?cellClone.style.height=C.offsetHeight+"px":f.setOuterHeight(cellClone,C.offsetHeight);null!=F&&(this._adjustReorderInnerTableWidth(F,l),this._processColGroup()&&this._hideReorderColGroupCols(F,d,e))}}}t+=v.offsetHeight;this._processColGroup()&&(this._hasFrozenColumn()&&!this._isColumnFrozen(d)||this._hideReorderColGroupCols(v,d,e,!0),this._hasFrozenColumn()&&!this._isColumnFrozen(d)&&this._adjustReorderNonFrozenCol(v,l))}};
AdfDhtmlTableBasePeer.prototype._cloneWithSelectedOption=function(a,b){if(null==a)return null;var d=a.cloneNode(b);if(1==a.nodeType){if(b){var e=a.getElementsByTagName("SELECT"),f=d.getElementsByTagName("SELECT"),g=e.length;AdfAssert.assert(g==f.length,"Unexpected clone--different amounts of selects!");for(var h=0;h<g;h++)f[h].selectedIndex=e[h].selectedIndex}"SELECT"==a.tagName&&(d.selectedIndex=a.selectedIndex)}return d};
AdfDhtmlTableBasePeer.prototype._insertEmptyDropColumn=function(a){var b=AdfDhtmlTableBasePeer._isRTL(),d=this.getDomElement(),e=AdfAgent.AGENT;a=e.getMousePosition(a);var f=e.getElementPosition(d),f=Math.max(a.x-f.x,0);a=this.__getColumnHeader();var g,h=AdfDhtmlTableBasePeer.__getChildBySubId(a,"t"),k;this._hasFrozenColumn()&&(g=AdfDhtmlTableBasePeer.__getChildBySubId(a,"d2"),k=AdfDhtmlTableBasePeer.__getChildBySubId(g,"t2"));a=0;if(b){var l=d.offsetWidth,m=h.offsetWidth,n=l-m;g&&f<=n?(d=k,l>m+k.offsetWidth?
a=l-(m+k.offsetWidth):(a=-this._getRTLScrollAdjustment(),this._getScrollHeight()>this._getScrollerOffsetHeight()&&(a+=this._getScrollerOffsetWidth()-this._getScrollerClientWidth()))):(d.offsetWidth>h.offsetWidth&&(a=n),d=h)}else this._freezeColumnsToEnd()?f>=k.offsetWidth?(a=k.offsetWidth,a-=this._currentScrollLeft,d=h):d=k:f<=h.offsetWidth?d=h:g?(a=h.offsetWidth,a-=this._currentScrollLeft,d=k):d=h;var q,l=null;if(d){this._hasFrozenColumn()||(a-=b?this._getRTLScrollAdjustment():this._currentScrollLeft);
for(var h=h.rows.length,m=AdfDhtmlTableBasePeer._ROOT_COLUMN,n=AdfDhtmlTableBasePeer._ROW_HEADER,r=h-1;0<=r;r--)for(var t=d.rows[r].cells,u=t.length,v=0;v<u;v++){var w=t[v];if(w.getAttribute(m)&&null==w.getAttribute(n)&&"none"!=w.style.display){var y=w.offsetLeft+a,z=y+w.offsetWidth;if(!b)if(f>=y&&f<=z-w.offsetWidth/2){l=w;q=!1;break}else{if(f>=y&&f<=z){l=w;q=-1==w.id.indexOf("_afrBlankColumn");break}}else if(f>=y&&f<=z-w.offsetWidth/2){l=w;q=-1==w.id.indexOf("_afrBlankColumn");break}else if(f>=y&&
f<=z){l=w;q=!1;break}}}if(null==l&&null==this._previousInsertColIndex)for(r=h-1;0<=r;r--){var t=d.rows[r].cells,u=t.length,B;0<u&&(B=t[u-1]);if(B&&B.getAttribute(m)&&null==B.getAttribute(n)){l=B==this._reorderTH&&B.previousSibling?B.previousSibling:B;q=!0;break}}null!=l&&(B=e.getIntAttribute(l,"_d_index",-1),f=l.colSpan,h=q?B+f:B,h!=this._previousInsertColIndex&&(this._removeEmptyDropColumn(k,g),this._targetReorderTH=l,this._insertColumnAfter=q,this._previousInsertColIndex=h,this._reorderDropColumnExtraX=
a,this._targetHeaderTable=d,this._insertEmptyDropColumnHeader(l,B,f,k,g),null!=g&&b&&e.setScrollLeft(g,this._currentScrollLeft),this._insertEmptyDropColumnBody(B,f),this._footerless||this._insertEmptyDropColumnFooter(B,f),this._processColGroup()&&this._forceRelayoutDataBody()))}};
AdfDhtmlTableBasePeer.prototype._removeEmptyDropColumn=function(a,b){var d=this._emptyDropCells;if(d){for(var e=AdfAgent.AGENT,f=e.getPlatform()==AdfAgent.WEBKIT_PLATFORM,e=e.getIntAttribute(this._targetReorderTH,"_d_index",-1),g=this._reorderColWidth,h=d.length-1;0<=h;h--){var k=d[h],l=k.tagName;f&&"COL"==l?k.parentNode.span--:"TD"!=l||!this._hasFrozenColumn()||this._isColumnFrozen(e)||k._afrIsFooter||this._adjustReorderInnerTableWidth(k.parentNode.parentNode.parentNode,g);k.parentNode.removeChild(k)}this._adjustReorderColumnHeaderWidths(this._targetHeaderTable,
b,e,g);this._processColGroup()&&this._hasFrozenColumn()&&!this._isColumnFrozen(e)&&this._adjustReorderDataBodyNonFrozenCol(g);this._footerless||this._adjustReorderColumnFooterWidths(e,g)}this._emptyDropCells=[]};
AdfDhtmlTableBasePeer.prototype._insertEmptyDropColumnHeader=function(a,b,d,e,f){e=AdfAgent.AGENT;for(var g=this._insertColumnAfter,h=this._reorderColWidth,k=this._emptyDropCells,l=this._lastFrozen,m=this._firstFrozen,n=this._targetHeaderTable,q=this._reorderEmptyCellWidth,r=a.ownerDocument,t=this._isFilterable(),u=t?3:2,v=0;v<u;v++){var w=n.rows[v],y=w.cells;if(v<u-1){var z=b;this._hasFrozenColumn()&&(this._freezeColumnsToStart()&&!this._isColumnFrozen(b)?z=b-l-1:this._freezeColumnsToEnd()&&this._isColumnFrozen(b)&&
(z=b-m));g&&(z+=d-1);headerCell=y[z]}else headerCell=a;y=r.createElement("th");g?headerCell.nextSibling?w.insertBefore(y,headerCell.nextSibling):w.appendChild(y):w.insertBefore(y,headerCell);0==v?y.style.cssText=headerCell.style.cssText:(y.className=AdfDhtmlTableBasePeer._DROP_TARGET_CLASS+" "+headerCell.className,v==u-1&&(y.rowSpan=n.rows.length-(t?2:1)),y.innerHTML="\x26nbsp;");q?y.style.width=q:(e.setOuterWidth(y,h),q=this._reorderEmptyCellWidth=parseInt(y.style.width)+"px");k.push(y)}this._adjustReorderColumnHeaderWidths(n,
f,b,-h);this._processColGroup()&&this._insertEmptyDropColGroupCol(n,b,d,g,h,k)};
AdfDhtmlTableBasePeer.prototype._insertEmptyDropColumnBody=function(a,b){for(var d=AdfAgent.AGENT,e=d.getPlatform()==AdfAgent.IE_PLATFORM,f=AdfDhtmlTableBasePeer._isRTL(),g=this._lastFrozen,h=this._firstFrozen,k=this._insertColumnAfter,l=this._reorderColWidth,m=this._emptyDropCells,n=this._reorderEmptyCellWidth,q=this._currentScrollLeft,r=this.GetDataBody(),t=r.childNodes,u=t.length,v=r.ownerDocument,w=AdfDhtmlTableBasePeer._DROP_TARGET_CLASS,y=this._currentScrollTop,z=k?a+b-1:a,B,C=0;C<u;C++){var A=
t[C],E=A.rows,F=E.length;0==C&&(B=A.startPos);for(var D=y-B,J=0;J<F;J++){var G=E[J];if(G.offsetTop-D>r.offsetHeight)break;if(!this._hasDetailStamp||!d.getAttribute(G,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)){var H,K=null;this._freezeColumnsToStart()&&!this._isColumnFrozen(a)?(K=this._getNestedScrolledTable(G),G=K.rows[0],H=G.cells[z-g-1]):this._freezeColumnsToEnd()?this._isColumnFrozen(a)?H=G.cells[z-h+1]:(K=this._getNestedScrolledTable(G),G=K.rows[0],H=G.cells[z]):H=G.cells[z];var L=v.createElement("td");
L.className=w+" "+H.className;k?H.nextSibling?G.insertBefore(L,H.nextSibling):G.appendChild(L):G.insertBefore(L,H);L.style.width=n;L.noWrap=!0;L.innerHTML="\x26nbsp;";m.push(L);null!=K&&(this._adjustReorderInnerTableWidth(K,-l),this._processColGroup()?this._insertEmptyDropColGroupCol(K,a,b,k,l,m):e&&(G=K.parentNode,(f||d.getScrollLeft(G)!=q)&&d.setScrollLeft(G,q)))}}B+=A.offsetHeight;this._processColGroup()&&(this._hasFrozenColumn()&&!this._isColumnFrozen(a)||this._insertEmptyDropColGroupCol(A,a,
b,k,l,m,!0),this._hasFrozenColumn()&&!this._isColumnFrozen(a)&&this._adjustReorderNonFrozenCol(A,-l))}f&&!this._hasFrozenColumn()&&d.setScrollLeft(r,q)};
AdfDhtmlTableBasePeer.prototype._insertEmptyDropColumnFooter=function(a,b){var d=AdfAgent.AGENT,e=d.getPlatform()==AdfAgent.WEBKIT_PLATFORM,f=this._lastFrozen,g=this._firstFrozen,h=this._insertColumnAfter,k=this._reorderColWidth,l=this._emptyDropCells,m=this._reorderEmptyCellWidth,n=this._getColumnFooter(),q,r=null,t=h?a+b-1:a;this._hasFrozenColumn()&&!this._isColumnFrozen(a)?(r=AdfDhtmlTableBasePeer.__getChildBySubId(n,"fd2"),q=AdfDhtmlTableBasePeer.__getChildBySubId(r,"ft2"),this._freezeColumnsToStart()&&
(t-=f+1),d.getScrollLeft(r)!=this._currentScrollLeft&&d.setScrollLeft(r,this._currentScrollLeft)):(q=AdfDhtmlTableBasePeer.__getChildBySubId(n,"ft"),this._freezeColumnsToEnd()&&this._isColumnFrozen(a)&&(t-=g));d=n.ownerDocument;for(g=0;2>g;g++)n=q.rows[g],f=d.createElement(0==g?"th":"td"),cell=n.cells[t],h?cell.nextSibling?n.insertBefore(f,cell.nextSibling):n.appendChild(f):n.insertBefore(f,cell),f.style.width=m,0==g?f.style.cssText=cell.style.cssText:(f.className=cell.className,f.innerHTML="\x26nbsp;",
f._afrIsFooter=!0,e&&(f.rowSpan="10")),l.push(f);this._adjustReorderColumnHeaderWidths(q,r,a,-k);this._processColGroup()&&this._insertEmptyDropColGroupCol(q,a,b,h,k,l)};AdfDhtmlTableBasePeer._columnReorderAnimationComplete=function(a){a._reorderColumnComponentsWithoutAnimation();a._cleanUpAfterColumnReorder()};
AdfDhtmlTableBasePeer.prototype._handleColReorderAbort=function(){var a=AdfAgent.AGENT;AdfAgent.AGENT.getPlatform();var b=this.__getColumnHeader(),d=AdfDhtmlTableBasePeer.__getChildBySubId(b,"t"),e,f;this._hasFrozenColumn()&&(e=AdfDhtmlTableBasePeer.__getChildBySubId(b,"d2"),f=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t2"));this._removeEmptyDropColumn(f,e);for(var b=a.getIntAttribute(this._reorderTH,"_d_index",-1),g=this._reorderHiddenCells,h=this._reorderColWidth,k=g.length,l,m,n=0;n<k;n++)l=g[n],
l.style.display="",l._afrOriginalWidth&&(l.style.width=l._afrOriginalWidth),"TD"!=l.tagName||l._afrIsFooter||(l=l.parentNode,this._hasFrozenColumn()&&!this._isColumnFrozen(b)&&l!=m&&this._adjustReorderInnerTableWidth(l.parentNode.parentNode,-h),m=l);this._processColGroup()&&this._hasFrozenColumn()&&!this._isColumnFrozen(b)&&this._adjustReorderDataBodyNonFrozenCol(-h);this._adjustReorderColumnHeaderWidths((this._hasFrozenColumn()&&!this._isColumnFrozen(b)?f:d,e,b,-h));this._footerless||this._adjustReorderColumnFooterWidths(b,
-h);null!=this._columnReorderTracker&&(this.getDomElement().removeChild(this._columnReorderTracker),this._columnReorderTracker=null);this._cleanUpAfterColumnReorder();a.enableUserSelect(this.__getColumnHeader())};AdfDhtmlTableBasePeer.prototype.GetFocusManager=function(){return this._focusManager};AdfDhtmlTableBasePeer.prototype.GetFocusedRowKey=function(){return this._focusManager.currency};
AdfDhtmlTableBasePeer.prototype.GetLastRowKey=function(){var a=this._focusManager.currency;if(null==a&&this._isRowSelectionEnabled()){var b=this.getComponent().getSelectedRowKeys(),d;for(d in b)b[d]!=AdfUITable._SELECT_ALL&&b[d]&&(a=d)}return a};AdfDhtmlTableBasePeer.prototype.suppressSelectionEventDelivery=function(a){this._suppressSelectionEventDelivery=a};AdfDhtmlTableBasePeer.prototype.canDeliverSelectionEvent=function(){return!this._suppressSelectionEventDelivery};
AdfDhtmlTableBasePeer.prototype._getTargetRowHeader=function(a){for(var b=null,d=this.getDomElement();a&&a!=d;){if("TD"==AdfAgent.getAgent().getNodeName(a)){null!=a.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)&&(b=a);break}a=a.parentNode}return b};AdfDhtmlTableBasePeer.prototype.__getSelectedColumns=function(){for(var a=this.__getVisibleLeafColumns(),b=[],d=a.length,e=0;e<d;e++){var f=a[e];f&&f.getSelected()&&b.push(f)}return b};
AdfDhtmlTableBasePeer.prototype.GetRowHeaderCellFromRow=function(a){AdfAssert.assert(null!=a,"Unable to get row header cell from a non-valid row!");AdfAgent.getAgent();for(var b=null,d=a.cells,e=d.length,f=0;f<e;f++)if(a=d[f],null!=a.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)){b=a;break}return b};
AdfDhtmlTableBasePeer.prototype._isTargetCellEditable=function(a,b){for(var d=AdfAgent.getAgent(),e,f=this.getDomElement(),g=AdfDhtmlTableBasePeer._INPUT_REGEXP;null!=a&&a!=f&&"TD"!=(e=d.getNodeName(a))&&"TH"!=e&&"TR"!=e;){if(3!=a.nodeType){var h=a.getAttribute("tabIndex",2);if(null!=h&&0<=h&&32768!=h&&65535!=h||e.match(g)&&(b||-1!=h))return!0}a=a.parentNode}return!1};
AdfDhtmlTableBasePeer.prototype._isTargetTextOnlyNode=function(a){return"SPAN"==a.tagName&&"on"==a.getAttribute(AdfDhtmlTableBasePeer._CELL_TEXT_KEY)?!0:!1};AdfDhtmlTableBasePeer.prototype._isTargetNavigable=function(a){return a&&"A"==a.tagName&&a.href&&0<a.href.length&&"#"!=a.getAttribute("href")};
AdfDhtmlTableBasePeer.prototype._handleRowMouseDownForC2E=function(a){this._handleRowMouseDown(a.evt,a.targetNode,a.isLeftButton,a.toggleKeyDown,a.shiftKeyDown,a.rowKey,a.row);this._handleRowMouseDownTimerId&&delete this._handleRowMouseDownTimerId};
AdfDhtmlTableBasePeer.prototype._handleRowMouseDown=function(a,b,d,e,f,g,h){(!this._isClickToEdit()&&this._editableTableReadOnlyMode||this._isClickToEdit()&&g&&this._getActiveRowKey()==g)&&this._setReadOnlyMode(!1,b,!1);if(!this._getExpandAction(b)){var k=AdfAgent.AGENT,l=this._getTargetRowHeader(b),m=null!=l,n=this._isTargetCellEditable(b),q=this._getCellAndIndexForNode(b,h),r=q.cellIndex;n||this._isClickToEdit()||this._contextMenuSelect||this._grabFocus();m?this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,
g,l):(d||this._contextMenuSelect)&&this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,g,h,q.cell);this._isClickToEdit()&&(this._getActiveRowKey()!=g||this.getComponent().getProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY))?(this._ctePatternStart=void 0,this._getActiveRowKey()!=g&&this._setActiveRowKey(g),this._saveClickToEditRequest(b,h),g&&this._setReadOnlyMode(!1,b,!1)):n&&this._ctePatternStart!=r&&(this._ctePatternStart=void 0);this._isRowSelectionEnabled()&&(l=this._selIsSelected(g),
d||this._contextMenuSelect&&!d)&&(l||(this._doRowSelection(b,e,f,g,h),this._ignoreRowClick=!0,n||null==a||k.eatEvent(a)),!n&&d||this._contextMenuSelect&&!d)&&(b=q.cell,this._isInDetailStampRow(b)||k.getDomWindow().AdfSafariMobileAgent&&k instanceof AdfSafariMobileAgent&&k.getOS()!=AdfAgent.ANDROID_OS||this._disableRowMouseDownCellFocus||this._setFocusOnEditableElementInNode(k,b)||(k.getPlatform()!=AdfAgent.IE_PLATFORM||this._isClickToEdit())&&this._setFocusOnNode(b),m&&this._isMultipleRowSelect()&&
null!=a&&(k.disableUserSelect(this.GetDataBody()),this._doRowHeaderDrag(a,g),k.eatEvent(a)))}};AdfDhtmlTableBasePeer.prototype._isInDetailStampRow=function(a){if(!this._hasDetailStamp)return!1;for(var b=this.getDomElement(),d=AdfAgent.AGENT;a&&a!=b;){if("TR"==d.getNodeName(a)&&d.getAttribute(a,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1))return!0;a=a.parentNode}return!1};
AdfDhtmlTableBasePeer.prototype._setFocusOnNode=function(a,b){var d=a.tabIndex;a.tabIndex=0;b?AdfFocusUtils.focusElementDelayed(a,1):AdfFocusUtils.focusElement(a);a.tabIndex=d};AdfDhtmlTableBasePeer.prototype._handleDataBodySelectStart=function(a){a||(a=AdfPage.PAGE.getDomWindow().event);var b=AdfAgent.AGENT,d=b.getEventTarget(a);this._isRowSelectionEnabled()&&!this._isTargetCellEditable(d)&&b.preventDefault(a)};
AdfDhtmlTableBasePeer.prototype._doRowHeaderDrag=function(a,b){this._startDragRowHeaderKey=b;null==this._handleRowHeaderDragCallback&&(this._handleRowHeaderDragCallback=this.createCallback(this._handleRowHeaderDrag),this._endRowHeaderDragCallback=this.createCallback(this._endRowHeaderDrag));AdfPage.PAGE.startDrag(a,this._handleRowHeaderDragCallback,this._endRowHeaderDragCallback)};
AdfDhtmlTableBasePeer.prototype._handleRowHeaderDrag=function(a,b,d){b=AdfAgent.getAgent();var e=b.getEventTarget(a);if(null!=this._getTargetRowHeader(e)){for(e=e.parentNode;e&&"TR"!=b.getNodeName(e);)e=e.parentNode;e&&(b=e.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),null!=b&&(this._selectRowRange(this._startDragRowHeaderKey,b),this._startDragRowHeaderKey=b,this._autoScrollRows(a)))}else for(d=this.getDomElement(),e=e.parentNode;e&&e!=d;){if("TR"==b.getNodeName(e)&&b.getAttribute(e,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,
!1)){this._autoScrollRows(a);break}e=e.parentNode}};
AdfDhtmlTableBasePeer.prototype._autoScrollRows=function(a){var b=AdfAgent.AGENT,d=this.GetDataBody();!(this._getScrollHeight()<=this._getScrollerOffsetHeight())&&(a=b.getMousePosition(a),b=b.getElementPosition(d),b=Math.max(a.y-b.y,0),d=b>d.offsetHeight-AdfDhtmlTableBasePeer._AUTOSCROLL_MARGIN,b<AdfDhtmlTableBasePeer._AUTOSCROLL_MARGIN||d)&&(d=this._currentScrollTop+(d?this._averageRowHeight:-this._averageRowHeight),0<=d&&d<this._getScrollHeight()&&this._scrollerScrollToPos(null,d))};
AdfDhtmlTableBasePeer.prototype._endRowHeaderDrag=function(a,b,d){this._startDragRowHeaderKey=null;AdfAgent.AGENT.enableUserSelect(this.GetDataBody())};
AdfDhtmlTableBasePeer.prototype._handleRowClick=function(a,b,d,e,f,g){AdfAgent.getAgent();var h=this._getTargetRowHeader(a),k=null!=h;this._ignoreRowClick?this._ignoreRowClick=!1:this._isRowSelectionEnabled()&&(k?this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,f,h):this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,f,g),(b||this._contextMenuSelect&&!b)&&this._doRowSelection(a,d,e,f,g))};
AdfDhtmlTableBasePeer.prototype._doRowSelection=function(a,b,d,e,f){var g=this._isMultipleRowSelect(),h=AdfAgent.AGENT;if(g&&b)this._unSelectAllColumns(),this._anchorRowKey=e,this._selIsSelected(e)?h.disableSelectionToggleOnEditableCell()&&this._isTargetCellEditable(a)||this._selUnselectRow(e,f):this._selSelectRow(e,f);else if(g&&d){a=this._anchorRowKey;if(!a)a=this._anchorRowKey=e;else if(!this.FindRowByKey(a)){b=this.getComponent();b=new AdfSelectionEvent(b,b.getSelectedRowKeys(),null);b.setSelectionRange(a,
e);b.queue();return}this.suppressSelectionEventDelivery(!0);this._selUnselectAll();this._queueColumnSelectionEvent();this.suppressSelectionEventDelivery(!1);this._selectRowRange(a,e)}else this._anchorRowKey=e,this._selIsOnlySelection(e)||(this.suppressSelectionEventDelivery(!0),this._selUnselectAll(),this.suppressSelectionEventDelivery(!1),this._selSelectRow(e,f),this._queueColumnSelectionEvent())};
AdfDhtmlTableBasePeer.prototype._selUnselectAll=function(){this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT,!0);this._unSelectAllColumns();this._updateTableSelectionState({})};
AdfDhtmlTableBasePeer.prototype._selSelectRow=function(a,b,d){this._selHighlightRow(b);d||(b={},(d=this.getComponent().getSelectedRowKeys())&&d[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]?(AdfCollections.copyInto(b,d),d=b[a],delete b[a],this._adjustSelectedRowKeyIndex(b,d)):(b[a]=1,this._mergeSelectedRowKeys(d,b,b)),this._updateTableSelectionState(b))};
AdfDhtmlTableBasePeer.prototype._selUnselectRow=function(a,b){this._selUnhighlightRow(b);var d={},e=this.getComponent().getSelectedRowKeys();e[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]?(d[a]=1,this._mergeSelectedRowKeys(e,d,d)):(AdfCollections.copyInto(d,e),e=d[a],delete d[a],this._adjustSelectedRowKeyIndex(d,e));this._updateTableSelectionState(d)};
AdfDhtmlTableBasePeer.prototype._mergeSelectedRowKeys=function(a,b,d,e){if(a&&b){e=0;for(var f in a)f in b||e++;for(var g in b)d[g]=b[g]+e;AdfCollections.copyInto(d,a)}else(a=a?a:b)&&AdfCollections.copyInto(d,a);return d};AdfDhtmlTableBasePeer.prototype._adjustSelectedRowKeyIndex=function(a,b){if(a&&b)for(var d in a)a[d]>b&&--a[d]};
AdfDhtmlTableBasePeer.prototype._selectRowRange=function(a,b){var d=this.GetDataBody();if(null!=d){var e=AdfAgent.getAgent(),f=this.getComponent(),g={},h=1,k=f.getSelectedRowKeys(),l=k[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY],m=!1,n=!1,d=d.childNodes,q=d.length,r=!0;f.getRowIndex(a)>f.getRowIndex(b)&&(r=!1);for(f=0;f<q&&!n;++f)for(var t=d[r?f:q-f-1].rows,u=t.length,v=0;v<u;++v){var w=t[r?v:u-v-1],y=e.getAttribute(w,AdfDhtmlTableBasePeer._ROW_KEY);if(null!=y){if(y==a||y==b){if(m||a==b)n=!0;m=
!0}m&&(this._selSelectRow(y,w,!0),l?(w=g[y],delete g[y],this._adjustSelectedRowKeyIndex(g,w)):(g[y+""]=h,h++));if(n)break}}this._mergeSelectedRowKeys(k,g,g);this._updateTableSelectionState(g)}};AdfDhtmlTableBasePeer.prototype._selIsSelected=function(a){var b=this.getComponent().getSelectedRowKeys();return b[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]?!b[a]:b[a]};
AdfDhtmlTableBasePeer.prototype._selIsOnlySelection=function(a){var b=this.getComponent().getSelectedRowKeys();if(null!=b[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY])return!1;var d=b[a];if(d)for(var e in b)if(e!=a){d=!1;break}return d};
AdfDhtmlTableBasePeer.prototype._selHighlightRow=function(a){AdfAssert.assertDomNode(a);AdfDomUtils.addCSSClassName(a,AdfDhtmlTableBasePeer._SELECTED_CLASS);"row"==a.getAttribute("role")&&a.setAttribute("aria-selected","true");AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._HIGHLIGHTED_CLASS);this.isInActiveHeirarchy()?AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._INACTIVE_CLASS):AdfDomUtils.addCSSClassName(a,AdfDhtmlTableBasePeer._INACTIVE_CLASS)};
AdfDhtmlTableBasePeer.prototype._selUnhighlightRow=function(a){AdfAssert.assertDomNode(a);AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._INACTIVE_CLASS);AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._SELECTED_CLASS);"row"==a.getAttribute("role")&&a.removeAttribute("aria-selected")};AdfDhtmlTableBasePeer.prototype._isColumnSelectionEnabled=function(){var a=this.getComponent().getColumnSelection?this.getComponent().getColumnSelection():null;return a&&a!=AdfDhtmlTableBasePeer._SELECTION_NONE};
AdfDhtmlTableBasePeer.prototype._isMultipleColumnSelect=function(){var a=this.getComponent().getColumnSelection?this.getComponent().getColumnSelection():null;return a&&a==AdfDhtmlTableBasePeer._SELECTION_MULTIPLE};AdfDhtmlTableBasePeer.prototype._isRowSelectionEnabled=function(a){a||(a=this.getComponent());return(a=a.getRowSelection())&&a.toLowerCase()!=AdfDhtmlTableBasePeer._SELECTION_NONE};
AdfDhtmlTableBasePeer.prototype._isMultipleRowSelect=function(){var a=this.getComponent().getRowSelection();return a&&-1!=a.toLowerCase().indexOf(AdfDhtmlTableBasePeer._SELECTION_MULTIPLE)};AdfDhtmlTableBasePeer.prototype._isMultipleRowSelectNoSelectAll=function(){var a=this.getComponent().getRowSelection();return a&&-1!=a.indexOf(AdfDhtmlTableBasePeer._SELECTION_MULTIPLE_NOSELECTALL)};
AdfDhtmlTableBasePeer.prototype._selUpdateAll=function(a,b,d){null==d&&(d=this.getComponent().getSelectedRowKeys());var e=!1;null!=d&&(e=d[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]?!0:!1);e?this._selectAllSelectionUpdate(a,b,d):this._normalSelectionUpdate(a,b,d)};
AdfDhtmlTableBasePeer.prototype._normalSelectionUpdate=function(a,b,d){var e=this.GetDataBody();if(null!=e&&(1==b&&(this._highlightedRowKey=null),d&&!AdfCollections.isEmpty(d))){for(var e=e.childNodes,f=e.length,g=AdfAgent.getAgent(),h=0;h<f;++h){var k=e[h].rows;if(k)for(var l=k.length,m=0;m<l;++m){var n=k[m],q=g.getAttribute(n,AdfDhtmlTableBasePeer._ROW_KEY);if(null!=q&&(0!=b||this._highlightedRowKey!=q))switch(a){case AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_SELECT:this._selHighlightRow(n);break;case AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT:this._selUnhighlightRow(n);
break;case AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE:d[q]?this._selHighlightRow(n):this._selUnhighlightRow(n)}}}this._updateColumnSelection(1!=a)}};
AdfDhtmlTableBasePeer.prototype._selectAllSelectionUpdate=function(a,b,d){var e=this.GetDataBody();if(null!=e&&(1==b&&(this._highlightedRowKey=null),d&&!AdfCollections.isEmpty(d)))for(var e=e.childNodes,f=e.length,g=AdfAgent.getAgent(),h=0;h<f;++h){var k=e[h].rows;if(k)for(var l=k.length,m=0;m<l;++m){var n=k[m],q=g.getAttribute(n,AdfDhtmlTableBasePeer._ROW_KEY);if(null!=q&&(0!=b||this._highlightedRowKey!=q))switch(a){case AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_SELECT:this._selHighlightRow(n);break;
case AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT:this._selUnhighlightRow(n);break;case AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE:d[q]?this._selUnhighlightRow(n):this._selHighlightRow(n)}}}};
AdfDhtmlTableBasePeer.prototype._selSelectAll=function(){var a=this.GetDataBody();if(null!=a&&this._isMultipleRowSelect()){this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT,!0);var b={};b[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]=!0;this._updateTableSelectionState(b);for(var a=a.childNodes,b=a.length,d=AdfAgent.getAgent(),e=0;e<b;++e)for(var f=a[e].rows,g=f.length,h=0;h<g;++h){var k=f[h];null!=d.getAttribute(k,AdfDhtmlTableBasePeer._ROW_KEY)&&this._selHighlightRow(k)}}};
AdfDhtmlTableBasePeer.prototype._unhiglightAnyExistingHighlightedRow=function(){var a=this._highlightedRowKey;a&&(this._highlightedRowKey=null,this._selIsSelected(a)||(this._selUnhighlightRow(this._highlightedRow),this._highlightedRow=null))};AdfDhtmlTableBasePeer.prototype._updateTableSelectionState=function(a){this._ignoreSelSet=!0;AdfLogger.LOGGER.finer("Update Table selection state to:",a);this.getComponent().setSelectedRowKeys(a);this._ignoreSelSet=!1};
AdfDhtmlTableBasePeer.prototype.ComponentSelectedRowKeysChanged=function(a,b,d,e){this._ignoreSelSet?(a=this.GetAssociatedComponent(),null!=a&&a.setSelectedRowKeys(d)):(this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT,!0,e),this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE,!0,d));this._pcPeer&&this._pcPeer.updateRowSelectionContext()};
AdfDhtmlTableBasePeer.prototype._resolveColumns=function(a,b,d){var e=AdfAgent.AGENT.getIntAttribute(d,"_d_index",-1);if(0<=e){var f=d.colSpan;if(null!=f&&1<(f=parseInt(f)))for(d=e+f;e<d;)b.push(this._getColumnHeaderLeafCell(e).id),a.push(e++);else a.push(e),b.push(d.id)}};
AdfDhtmlTableBasePeer.prototype._handleColumnHeaderDrag=function(a,b,d){b=this.__getColumnHeaderMouseAction(a);null!=b&&"select"==b.type&&(d=b.colIndices,0<d.length&&(this._selectColumnRange(this._activeColIndices,this._activeColIds,d,b.colIds),this._queueColumnSelectionEvent()));this._autoScrollColumnsIfNecessary(a);this._pcPeer&&this._pcPeer.updateStandardMenuToolbarItems()};
AdfDhtmlTableBasePeer.prototype._handleColumnHeaderDrop=function(a,b,d){a=this.__getColumnHeader();AdfAgent.AGENT.enableUserSelect(a);this._queueColumnSelectionEvent()};
AdfDhtmlTableBasePeer.prototype._doColumnSelections=function(a,b,d){var e=AdfPage.PAGE,f=this._isMultipleColumnSelect(),g=AdfAgent.AGENT.getDomWindow();if(!f||g.AdfSafariMobileAgent&&AdfAgent.AGENT instanceof AdfSafariMobileAgent||!AdfAgent.AGENT.isSelectionToggle(a))if(a.shiftKey&&this._isMultipleColumnSelect())this._activeColIndices&&0<=this._activeColIndices.length&&(this._clearColumnSelectionEventChangedSets(),this._selUnselectAll(),this._selectColumnRange(this._activeColIndices,this._activeColIds,
b,d),this._queueColumnSelectionEvent());else{this._activeColIndices=b;this._activeColIds=d;this._clearColumnSelectionEventChangedSets();this._selUnselectAll();for(a=0;a<b.length;a++)f=e.findComponent(d[a]),this._selectColumn(b[a],f,!1);this._queueColumnSelectionEvent()}else{a=this.getComponent().getSelectedRowKeys();AdfCollections.isEmpty(a)||(this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT,!0),this._updateTableSelectionState({}));this._activeColIndices=b;this._activeColIds=d;for(a=
0;a<b.length;a++)f=e.findComponent(d[a]),f.getSelected()?this._unSelectColumn(b[a],f,!1):this._selectColumn(b[a],f,!1);this._queueColumnSelectionEvent()}this._pcPeer&&this._pcPeer.updateStandardMenuToolbarItems()};
AdfDhtmlTableBasePeer.prototype._selectColumn=function(a,b,d){b.getSelected()||(b.setProperty(AdfRichColumn.SELECTED,!0,!0,AdfUIComponent.PROPAGATE_NEVER),this._highlightColumn(a),this._isClickToEdit()&&this._getActiveRowKey()&&this._setActiveRowKey(null),this._colSelEventSelectedColIds[b.getClientId()]=!0,d&&this._queueColumnSelectionEvent())};
AdfDhtmlTableBasePeer.prototype._unSelectColumn=function(a,b,d){b.getSelected()&&(b.setProperty(AdfRichColumn.SELECTED,!1,!0,AdfUIComponent.PROPAGATE_NEVER),this._unHighlightColumn(a),this._colSelEventUnselectedColIds[b.getClientId()]=!0,d&&this._queueColumnSelectionEvent())};
AdfDhtmlTableBasePeer.prototype._unSelectAllColumns=function(){if(this._isColumnSelectionEnabled()){var a=AdfPage.PAGE,b=this._colCount,d;this._clearColumnSelectionEventRemovedSet();for(var e=0;e<b;e++)(d=this._getColumnHeaderLeafCell(e))&&this._unSelectColumn(e,a.findComponent(d.id),!1)}this._pcPeer&&this._pcPeer.updateStandardMenuToolbarItems()};
AdfDhtmlTableBasePeer.prototype._updateColumnSelection=function(a){if(!this._headerless)for(var b=AdfPage.PAGE,d=this._colCount,e=0;e<d;e++){var f=this._getColumnHeaderLeafCell(e);f&&b.findComponent(f.id).getSelected()&&(a?this._highlightColumn(e):this._unHighlightColumn(e))}};
AdfDhtmlTableBasePeer.prototype._selectColumnRange=function(a,b,d,e){for(var f=AdfPage.PAGE,g=0;g<a.length;g++)this._selectColumn(a[g],f.findComponent(b[g]));g=d[0]>a[0]?1:-1;a=a[0];for(b=b[0];a!=d[0];)this._selectColumn(a,f.findComponent(b)),a+=g,b=this._getColumnHeaderLeafCell(a).id;for(g=0;g<d.length;g++)this._selectColumn(d[g],f.findComponent(e[g]))};
AdfDhtmlTableBasePeer.prototype._highlightColumn=function(a){var b=this._getColumnHeaderLeafCell(a);this._highlightCell(b,!0);for(var b=this.GetDataBody().childNodes,d=b.length,e=null,f=AdfAgent.getAgent(),g=0;g<d;++g)for(var h=b[g].rows,k=h.length,l=0;l<k;++l)f.getAttribute(h[l],AdfDhtmlTableBasePeer._ROW_KEY,null)&&(null==e&&(e=this.isInActiveHeirarchy()),this._hasFrozenColumn()&&!this._isColumnFrozen(a)?this._highlightCell(this._getInnerTableCell(h[l],a),e):!this._hasFrozenColumn()||this._freezeColumnsToStart()?
this._highlightCell(h[l].cells[a],e):this._highlightCell(h[l].cells[a-this._firstFrozen+1],e))};
AdfDhtmlTableBasePeer.prototype._unHighlightColumn=function(a){var b=this._getColumnHeaderLeafCell(a);this._unHighlightCell(b,!0);for(var b=this.GetDataBody().childNodes,d=b.length,e=AdfAgent.getAgent(),f=0;f<d;++f)for(var g=b[f].rows,h=g.length,k=0;k<h;++k)e.getAttribute(g[k],AdfDhtmlTableBasePeer._ROW_KEY,null)&&(this._hasFrozenColumn()&&!this._isColumnFrozen(a)?this._unHighlightCell(this._getInnerTableCell(g[k],a)):!this._hasFrozenColumn()||this._freezeColumnsToStart()?this._unHighlightCell(g[k].cells[a]):
this._unHighlightCell(g[k].cells[a-this._firstFrozen+1]))};AdfDhtmlTableBasePeer.prototype._highlightCell=function(a,b){AdfDomUtils.addCSSClassName(a,AdfDhtmlTableBasePeer._SELECTED_CLASS)};AdfDhtmlTableBasePeer.prototype._unHighlightCell=function(a){AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._SELECTED_CLASS);AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._INACTIVE_CLASS)};
AdfDhtmlTableBasePeer.prototype._getParentTH=function(a){a=AdfAgent.AGENT.getEventTarget(a);for(var b=null,d=this.getDomElement();!b&&a&&a!=d&&1==a.nodeType;)a.getAttribute("_d_index")?b=a:a=a.parentNode;return b};AdfDhtmlTableBasePeer.prototype._getColumnHeaderCellForEvent=function(a){var b=null,d=this.__getColumnHeader(),e=AdfAgent.AGENT,d=e.getElementPosition(d);e.getMousePosition(a).y-d.y<=this._cachedCHHeight&&(b=this._getParentTH(a));return b};
AdfDhtmlTableBasePeer.prototype.__getColumnHeaderMouseAction=function(a){var b=null;if(!this._headerless){var d=AdfAgent.AGENT,e=null,f=this.__getColumnHeader(),f=d.getElementPosition(f),g=d.getMousePosition(a);g.y-f.y<=this._cachedCHHeight&&(e=this._getParentTH(a));if(e){b={};b.cell=e;if(null!=e.getAttribute("_afrFH"))return b.type="clearAllFilter",b;if(!this._virtInitialized)return null;var f=null,h=d.getIntAttribute(e,"_d_index",-1),k=AdfDhtmlTableBasePeer._isRTL();if(-1!=h&&"enabled"==this.getComponent().getColumnResizing()){var d=
d.getElementPosition(e),d=g.x-d.x,g=e.offsetWidth,l=!(-1!=this._lastColWidthOverride&&h==this._colCount-1);d<=this.__getColumnResizeMargin()?k?l&&(f="end"):0<h&&(f="start"):g-d<=this.__getColumnResizeMargin()&&(k?0<h&&(f="start"):l&&(f="end"))}f?(b.type="resize",b.data=f):this._getColHeaderMouseSelAction(a,b,e)}}return b};
AdfDhtmlTableBasePeer.prototype._getColHeaderMouseSelAction=function(a,b,d){var e=AdfAgent.AGENT,f=e.getEventTarget(a),g=this._isColumnSelectionEnabled(),h=f.parentNode.getAttribute(AdfDhtmlTableBasePeer._SORT_ASCENDING);h||(h=f.parentNode.parentNode.getAttribute(AdfDhtmlTableBasePeer._SORT_ASCENDING));var k=f.parentNode.getAttribute(AdfDhtmlTableBasePeer._SORT_DESCENDING);k||(k=f.parentNode.parentNode.getAttribute(AdfDhtmlTableBasePeer._SORT_DESCENDING));if(h||k){if("click"==a.type){e=e.getElementById(AdfRichUIPeer.CreateSubId(d.id,
AdfDhtmlTableBasePeer.__SORT_INDICATOR));a=e.getAttribute(AdfDhtmlTableBasePeer._SORTED_TYPE);if(h)if(a==AdfDhtmlTableBasePeer._SORTED_ASCENDING){if(!this._singleSortIcon)return;b.sortOrder=!1}else b.sortOrder=!0;else if(k)if(a==AdfDhtmlTableBasePeer._SORTED_DESCENDING){if(!this._singleSortIcon)return;b.sortOrder=!0}else b.sortOrder=!1;b.type="sort";b.sortProperty=AdfPage.PAGE.findComponent(d.id).getSortProperty()}}else null!=d.getAttribute(AdfDhtmlTableBasePeer._SELECT_ALL)?b.type="selectAll":-1==
d.id.indexOf("_afrBlankColumn")&&(!g&&this.getComponent().getDisableColumnReordering()&&null==d.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)?b.type="default":g||null!=d.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)||null==d.getAttribute(AdfDhtmlTableBasePeer._ROOT_COLUMN)?null==d.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)?g&&e.isSelectionToggle(a)||!this._shouldEnableColumnReorder(a,d)?d.id&&g?(b.type="select",this._resolveColumns(b.colIndices=[],b.colIds=[],d)):b.type="default":this.getComponent().getDisableColumnReordering()||
(b.type="move"):b.type="default":(e=e.getElementById(AdfRichUIPeer.CreateSubId(d.id,AdfDhtmlTableBasePeer.__SORT_INDICATOR)),null!=e?"click"==a.type?(a=e.getAttribute(AdfDhtmlTableBasePeer._SORTED_TYPE),b.sortOrder=a==AdfDhtmlTableBasePeer._SORTED_ASCENDING?!1:!0,b.type="sort",b.sortProperty=AdfPage.PAGE.findComponent(d.id).getSortProperty()):b.type="mousemove"==a.type?"default":"move":b.type="move"))};
AdfDhtmlTableBasePeer.prototype._shouldEnableColumnReorder=function(a,b){var d=AdfPage.PAGE,e=!1,f=null,g=this._flattenedColumns,g=null!=b.getAttribute(AdfDhtmlTableBasePeer._LEAF_COLUMN),h=null!=b.getAttribute(AdfDhtmlTableBasePeer._ROOT_COLUMN);if(g&&h)b.id&&0<b.id.length&&d.findComponent(b.id).getSelected()&&(f=[b.id]);else if(h)if(this._resolveColumns([],f=[],b),0==f.length)f=null;else for(i=f.length-1;0<=i;--i)if(!d.findComponent(f[i]).getSelected()){f=null;break}if(f)for(e=!0,g=this.__getVisibleLeafColumns(),
i=g.length-1;0<=i;--i)if((d=g[i])&&d.getSelected()){h=!1;for(j=f.length-1;0<=j;--j)if(d.getClientId()==f[j]){h=!0;break}if(!h){e=!1;break}}return e};AdfDhtmlTableBasePeer.prototype._handleColResizeDrag=function(a,b,d){a=this._getColumnResizeIndicator().style;d=parseInt(a.left);var e=parseInt(this._resizedTH.style.width),f=this._resizeColDelta+(AdfDhtmlTableBasePeer._isRTL()?-b:b),g=this._getLargestMinimumWidth();this._resizeColDelta=f;e+f>=g&&(a.left=d+b+"px")};
AdfDhtmlTableBasePeer.prototype._getLargestMinimumWidth=function(){var a=this._resizedIndex,b=this.__getVisibleLeafColumns()[a],a=this._largestMinimumWidth;if(null==a){var a=0,d=this.__getSelectedColumns();if(-1==AdfCollections.indexOf(d,b))a=b.getMinimumWidth();else for(var b=d.length,e=0;e<b;e++)var f=d[e].getMinimumWidth(),a=Math.max(a,f);this._largestMinimumWidth=a}return this._largestMinimumWidth};
AdfDhtmlTableBasePeer.prototype._handleColResizeDrop=function(a,b,d){a=this._getColumnResizeIndicator();this._hideElement(a);this.isHeightAutoSized()&&2>=this._autoHeightRows&&this._restoreHorizontalScrollBarForIE8(17);a=this._resizeColDelta;b=this._resizedTH;d=parseInt(a)+parseInt(b.style.width);var e=this._getLargestMinimumWidth();d=Math.max(d,e);this._hasFrozenColumn()&&this._isColumnFrozen(this._resizedIndex)&&(e=Math.max(this.GetDataBody().clientWidth-10,e),b.offsetLeft+d>=e&&(d=e-b.offsetLeft));
AdfAssert.assert(!isNaN(d),"Illegal width for column resize drop.  delta \x3d "+a+", th.style.width \x3d "+b.style.width);this._doColResizesFromUser(d,null)};
AdfDhtmlTableBasePeer.prototype._restoreHorizontalScrollBarForIE8=function(a){var b=this.GetScroller(),d=AdfAgent.getAgent(),e=d.getPlatform()==AdfAgent.IE_PLATFORM;if(null!=b&&e&&2>this.GetRowCount()){var e=this.getDomElement(),f=this._getScrollbarHeight(),g=this.GetDataBody(),g=this.IsEmpty?g.offsetHeight:this._computeAutoHeight(),h=null,k=0,d=d.getVersion();if(7<d&&9>d){h=b;if(!this._hasSingleScroller()||this._isPaged)h=b[AdfDhtmlTableBasePeer._HSCROLLER];null!=this._averageRowHeight&&(k=this._averageRowHeight,
h.style.minHeight=(a?a:8)+k+"px");null!=h&&(a=this._getScrollbarHeight(),f!=a&&(newHeight=g+this._cachedCHHeight+this._cachedCFHeight+a,this._sizeOuterContainer(e,newHeight),this._setScrollerHeight(newHeight,this._cachedCHHeight,this._cachedCFHeight,this._cachedNBHeight)),h.style.minHeight=k+"px")}}};
AdfDhtmlTableBasePeer.prototype._doColResizesFromUser=function(a,b){this._resizedTH=this._largestMinimumWidth=null;var d=this._resizedIndex,e=this.__getVisibleLeafColumns(),f=e.length,g=e[d],h=this.GetDataBody(),k=this.__getSelectedColumns(),l=!1;null==b&&(l=-1!=AdfCollections.indexOf(k,g));var m;this.IsEmpty||(m=h.childNodes[0].rows[0],AdfAssert.assert(null!=m,"this.IsEmpty was "+this.IsEmpty+" but there were no rows!"));var n=[],g=[],q,r=0,t=0,u,v=this._columnStretching;for(u=0;u<f;u++){q=e[u];
var w=this._getColumnFlex(q,null,v,f,u),h=this._getColumnActualWidth(u,m);l&&-1!=AdfCollections.indexOf(k,q)||!l&&u==d?(null!=b&&(w=this._getColumnFlex(null,b,v,f,u)),r++,t+=h,g.push({component:q,displayIndex:u,flex:w,minimumWidth:q.getMinimumWidth(),actualWidth:h})):null!=w&&q.getMinimumWidth()}if("none"!=v&&"blank"!=v)return this._userDragStretchedColumns(a,b,m,g,e,v);d=r*a-t;h=Math.abs(d);u=n.length;q=Math.floor(h/u);k=h-u*q;l=0;do{for(m=0;m<u;m++)f=n[m],1!=f.atMinimum&&(e=f.minimumWidth,h=f.actualWidth,
r=q,0<k&&(r+=k,k=0),0>d&&(r*=-1),r=h-r,t=f.desiredWidth,null!=t&&(r+=t-h),e=Math.max(e,r),e!=r&&(f.atMinimum=!0,l++),k+=e-r,f.desiredWidth=e);q=0}while(0!=k&&l<u);n=[].concat(n);h=g.length;for(u=0;u<h;u++)q=g[u],null==q.flex?(delta=a-q.actualWidth,this._doResizeColumn(q.displayIndex,null,a,delta,!0)):(q.desiredWidth=a,n.push(q));g=n.length;for(u=f=0;u<g;u++)q=n[u],e=q.desiredWidth,h=q.actualWidth,null==e&&(e=h,q.desiredWidth=e),q.delta=e-h,f+=e;h=[];for(u=0;u<g;u++)q=n[u],e=q.desiredWidth,delta=q.delta,
d=q.displayIndex,this._doResizeColumn(d,null,e,delta,!1),k=Math.round(1E4*e/f)+"%",q=q.component,this._ignoreSetColWidth=!0,q.setProperty(AdfRichColumn.WIDTH,k,!0),delete this._ignoreSetColWidth,h.push({displayIndex:d,width:e});this._currentColumnStretchDetails=h;this._stretchTheColumns();g=this.__getColumnHeader();AdfAgent.AGENT.enableUserSelect(g)};
AdfDhtmlTableBasePeer.prototype._userDragStretchedColumns=function(a,b,d,e,f,g){var h=[],k=e.length,l=0,m=0,n,q,r=!1;if(null==b||isNaN(b))b=0,r=!0;for(q=0;q<k;q++)n=e[q],n.desiredWidth=n.minimumWidth,h[n.displayIndex]=n,l+=n.minimumWidth,m=Math.max(m,n.actualWidth),r&&(b+=n.actualWidth);var t=0,u=0,v,w=!1;q=[];if(a>m){var w=!0,r=e[k-1].displayIndex+1,y=r==f.length;for(y&&r--;r<f.length;r++)q.push(this._createStretchColumnData(r,f[r],d)),v=q.length-1,t+=q[v].minimumWidth,u+=q[v].actualWidth}else for(r=
e[0].displayIndex-1;0<=r;r--)q.push(this._createStretchColumnData(r,f[r],d)),v=q.length-1,t+=q[v].minimumWidth,u+=q[v].actualWidth;r=u-t;this._nothingFlexible&&(t=this.GetDataBody(),(u=t.childNodes)&&u[0]&&(t=t.offsetWidth-this._totalWidth,0<t&&(r+=t)));m=a-m;if(0<=m&&m>r&&(a=r+l,m=r,0>=a))return;e.sort(AdfDhtmlTableBasePeer.__columnSortComparator);for(b=b-l+m;0!=b;){t=[];u=e[0].desiredWidth;for(r=0;r<k;r++)if(v=0,n=e[r],e[r+1]?v=n.desiredWidth:(u=Math.abs(b),v=Math.abs(b)),v<=u)t.push(n);else break;
v=Math.floor(b/t.length);v>u&&t.length<k&&(v=e[t.length].desiredWidth-t[t.length-1].desiredWidth);for(r=0;r<t.length;r++)t[r].desiredWidth+=v,b-=v;1>b/t.length&&(e[k-1].desiredWidth+=b,b=0)}for(r=0;r<k;r++)this._shouldResizeCol(n.displayIndex)&&(n=e[r],n.flex=Math.abs(n.desiredWidth),this._doResizeColumn(n.displayIndex,null,n.flex,n.flex-n.actualWidth,!0));w||(e=e[k-1].displayIndex+1,f[e]||e++,this._shouldResizeCol(e)&&e<f.length&&(k=Math.abs(m),q[e]={component:f[e],displayIndex:r,minimumWidth:f[e].getMinimumWidth(),
actualWidth:this._getColumnActualWidth(e,d)},q[e].actualWidth+=k,this._doResizeColumn(e,null,q[e].actualWidth,k,!0),a>=l&&(m=0)));if(w&&!y)for(y=m,e=!1,r=0;r<q.length;r++)if(e||(e=!this._shouldResizeCol(q[r].displayIndex)),!e&&(a=q[r],a.component))if(l=a.actualWidth-a.minimumWidth,y>=l)a.newWidth=a.minimumWidth,a.flex=a.newWidth,h[a.displayIndex]=a,this._doResizeColumn(a.displayIndex,null,a.newWidth,-l,!0),y-=l;else{a.newWidth=a.actualWidth-y;a.flex=a.newWidth;h[a.displayIndex]=a;this._doResizeColumn(a.displayIndex,
null,a.newWidth,-y,!0);break}q=[];for(r=0;r<f.length;r++)h[r]||(a=this._getColumnFlex(f[r],null,g,f.length,r))&&q.push({displayIndex:r,width:this._getColumnActualWidth(r,d)});this._currentColumnStretchDetails=q;this._stretchTheColumns();d=this.__getColumnHeader();AdfAgent.AGENT.enableUserSelect(d)};AdfDhtmlTableBasePeer.prototype._shouldResizeCol=function(a){return"multiple"!=this._columnStretching?!0:!this._isLastFlexColumn(a)};
AdfDhtmlTableBasePeer.prototype._isLastFlexColumn=function(a){var b=this.__getVisibleLeafColumns(),d=b.length,e=this._columnStretching,f=-1;AdfAssert.assert("multiple"==e,"This fuction must not be called when columnStretching is: "+e);for(var g=!1,h=0;h<d;h++)if(null!=this._getColumnFlex(b[h],null,e,d,h)){if(g)return!1;g=!0;f=h}return g&&a==f};
AdfDhtmlTableBasePeer.prototype._createStretchColumnData=function(a,b,d){var e=null;b?e={component:b,displayIndex:a,minimumWidth:b.getMinimumWidth(),actualWidth:this._getColumnActualWidth(a,d)}:(b=this._getColumnActualWidth(a,d),e={component:null,displayIndex:a,minimumWidth:b,actualWidth:b});return e};AdfDhtmlTableBasePeer.__columnSortComparator=function(a,b){return a.minimumWidth-b.minimumWidth};
AdfDhtmlTableBasePeer.prototype.__getPixelWidthFromPercent=function(a){a=parseInt(a);return isNaN(a)?null:(a=this.GetDataBody().offsetWidth*a/100,a.toFixed(0))};
AdfDhtmlTableBasePeer.prototype.resizeColumn=function(a,b,d){if(!this._ignoreSetColWidth){for(var e=0<b.toString().indexOf("%"),f=a.getClientId(),g=this.__getColumnHeader(),h=AdfAgent.AGENT,g=g.getElementsByTagName("th"),k=g.length,l,m=0;m<k;++m)if(g[m].id==f){l=g[m];this._resizedIndex=f=h.getIntAttribute(l,"_d_index",0);break}if(l){l=100;null!=b&&(l=b,e&&(l=this.__getPixelWidthFromPercent(b)));if(isNaN(l)||0>=l||3200<l)l=100;b=this.__getSelectedColumns();if(-1!=AdfCollections.indexOf(b,a))for(a=
b.length,e=0;e<a;e++)l=Math.max(l,b[e].getMinimumWidth());else l=Math.max(l,a.getMinimumWidth());this._doColResizesFromUser(l,d)}}};
AdfDhtmlTableBasePeer.prototype._doResizeColumn=function(a,b,d,e,f){var g=!1,h=!1,k=!1,l=!1;this._hasFrozenColumn()&&(this._totalWidth=void 0!==this._totalWidth?this._totalWidth+e:e,this._isColumnFrozen(a)?(this._frozenWidth+=e,k=!0):(this._unfrozenWidth+=e,l=!0));var m=this.GetDataBody();!k&&!l||this.IsEmpty||this._sizeRegionsForFrozenColumns(m,m.offsetWidth);this._headerless||(l=this.__getColumnHeader(),b||(b=this._getColumnHeaderFooterSizingCell(a,l,"t","d2","t2")),this._resizeColumnHeaderFooterColumn(b,
e,l,a,"t","d2","t2"),this.IsEmpty?("multiple"!=this._columnStretching&&this._incrementWidth(l,e),this._synchronizeColumnRowHeights(l,"t","d2","t2")):(this._synchronizeColumnRowHeights(l,"t","d2","t2"),b=l.offsetHeight,b!=this._cachedCHHeight&&(this._cachedCHHeight=b,g=!0)));this._footerless||(l=this._getColumnFooter(),b=this._getColumnHeaderFooterSizingCell(a,l,"ft","fd2","ft2"),this._resizeColumnHeaderFooterColumn(b,e,l,a,"ft","fd2","ft2"),this.IsEmpty?(this._incrementWidth(l,e),this._synchronizeColumnRowHeights(l,
"ft","fd2","ft2")):(this._synchronizeColumnRowHeights(l,"ft","fd2","ft2"),b=l.offsetHeight,b!=this._cachedCFHeight&&(this._cachedCFHeight=b,h=!0)));if(!this.IsEmpty){e=this._resizeDataBodyColumn(m,a,e);if(g||h||k)g=this.getDomElement(),this._setScrollerTop(this._cachedCHHeight),this._setScrollerHeight(g.clientHeight,this._cachedCHHeight,this._cachedCFHeight,this._cachedNBHeight),this._setScrollerWidth(g.clientWidth,this._frozenWidth);g=m.firstChild;g=this._hasFrozenColumn()?this._areAllColumnsFrozen()?
0:parseInt(this._getNestedScrolledTable(g.rows[0]).clientWidth):parseInt(g.getBoundingClientRect().width);this._setFakeCanvasWidth(g);g=e.relFactor;h=e.delta;g=void 0!=h?h:Math.round((g-1)*this._averageRowHeight*this.GetKnownRowCount());this._adjustCanvasHeight(g,m,!0,!0);f&&(a=this.__getVisibleLeafColumns()[a],this._ignoreSetColWidth=!0,a.setProperty(AdfRichColumn.WIDTH,d,!0),delete this._ignoreSetColWidth);d=this.__getScrollLeft();this._currentScrollLeft!=d&&(this._currentScrollLeft=d,this._handleHorizontalScroll(d));
this._virtInitialized||this._fillViewPort(m,m.offsetHeight,!1)}};
AdfDhtmlTableBasePeer.prototype._resizeColumnHeaderFooterColumn=function(a,b,d,e,f,g,h){a=this._incrementWidth(a,b);f=AdfDhtmlTableBasePeer.__getChildBySubId(d,f);this._hasFrozenColumn()?(d=AdfDhtmlTableBasePeer.__getChildBySubId(d,g),h=AdfDhtmlTableBasePeer.__getChildBySubId(d,h),this._freezeColumnsToStart()?this._isColumnFrozen(e)?(this._incrementWidth(f,b),b=f.style.width,e=d.style,AdfDhtmlTableBasePeer._isRTL()?e.right=b:e.left=b):this._incrementWidth(h,b):this._isColumnFrozen(e)?this._incrementWidth(f,
b):(this._incrementWidth(h,b),b=h.style.width,AdfDhtmlTableBasePeer._isRTL()?f.style.right=b:f.style.left=b)):this._incrementWidth(f,b);return a};
AdfDhtmlTableBasePeer.prototype._resizeDataBodyColumn=function(a,b,d){var e=0,f=0;a=a.childNodes;for(var g=a.length-1;0<=g;g--){var h=a[g],e=e+h.cachedHeight;this._resizeBlockColumn(h,b,d);h._lastSyncRow=null;this._synchronizeRowHeights(h);var k=h.offsetHeight,f=f+k;if(k!=h.cachedHeight)for(var l=k-h.cachedHeight,m=g+1;m<a.length;m++)a[m].startPos+=l;h.cachedHeight=k}b=1==a.length&&0==a[0].startRow&&a[0].numRows==this.GetKnownRowCount()?f-e:void 0;return{relFactor:f/e,delta:b}};
AdfDhtmlTableBasePeer.prototype._resizeBlockColumn=function(a,b,d){if(!this._hasFrozenColumn()||this._isColumnFrozen(b))a.rows&&(this._freezeColumnsToEnd()?this._incrementWidth(a.rows[0].cells[b-this._firstFrozen+1],d):this._incrementWidth(a.rows[0].cells[b],d));else for(var e=a.rows,f=0;f<e.length;f++){var g;g=this._getNestedScrolledTable(e[f]);this._incrementWidth(g,d);g=this._freezeColumnsToStart()?g.rows[0].cells[b-this._lastFrozen-1]:g.rows[0].cells[b];this._incrementWidth(g,d)}this._hasFrozenColumn()||
this._incrementWidth(a,d)};AdfDhtmlTableBasePeer.prototype._incrementWidth=function(a,b){AdfAssert.assertDomNode(a);var d=parseInt(a.style.width)+b;isNaN(d)||(a.style.width=d+"px");if(this._processColGroup()&&("TH"==a.tagName||"TD"==a.tagName)){var e=this._findColGroupColumn(a);e&&(d=parseInt(e.style.width)+b,e.style.width=d+"px")}return d};
AdfDhtmlTableBasePeer.prototype._findColGroupColumn=function(a,b){AdfAssert.assertDomNode(a);AdfAssert.assert("TH"==a.tagName||"TD"==a.tagName,"Invalid COLGROUP tag name");for(var d=a.parentNode;d&&"TR"!=d.tagName;)d=d.parentNode;if(d){for(var e=d.cells,f=e.length,g=0;g<f&&e[g]!=a;g++);if(g<f){for(d=d.parentNode;d&&"TABLE"!=d.tagName;)d=d.parentNode;if(d&&(d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(d,"COLGROUP")))for(d=d.childNodes,++g,e=0;e<d.length;e++)if("COL"==d[e].tagName&&--g,0==g)return d[e]}}return null};
AdfDhtmlTableBasePeer.SetCursor=function(a,b){a&&a.style.cursor!=b&&(a.style.cursor=b)};
AdfDhtmlTableBasePeer.prototype._handleColumnContextMenu=function(a,b){if(this._pcPeer){var d=b?b:this._getParentTH(a);if(d&&null!=d.getAttribute(AdfDhtmlTableBasePeer._LEAF_COLUMN)){var e=AdfPage.PAGE.findComponent(d.id);!e.getSelected()&&this._isColumnSelectionEnabled()&&(this._selUnselectAll(),d=AdfAgent.AGENT.getIntAttribute(d,"_d_index",-1),this._selectColumn(d,e,!0));this._pcPeer.showColumnContextMenu(a,b)}}};
AdfDhtmlTableBasePeer.prototype._handleBodyContextMenu=function(a){var b=this.getComponent(),d=b.getBodyContextMenuId?b.getBodyContextMenuId():null;if(d){b.setSelectedRowKeys({});var e=b.findComponent(d);null==e&&(AdfPage.PAGE.findComponent(d),b=null);this.showContextMenu(a,d,b);AdfAgent.AGENT.eatEvent(a)}};AdfDhtmlTableBasePeer.prototype.GetRowContextMenuId=function(a){return this.getComponent().getContextMenuId()};
AdfDhtmlTableBasePeer.prototype._getRowContextMenuAndContainer=function(a){a=this.GetRowContextMenuId(a);var b,d;if(a){var e=this.getComponent();b=AdfPage.PAGE.findComponent(a);d=null;null==b&&(b=e.findComponent(a),d=e);null==b&&AdfLogger.LOGGER.severe("Could not find context menu ",a," from component ",e)}return{popup:b,menuId:a,menuFindContainer:d}};
AdfDhtmlTableBasePeer.prototype.HandleRowContextMenu=function(a,b,d,e,f){var g=this._getRowContextMenuAndContainer(b),h=g.popup,k=g.menuFindContainer,l=g.menuId;h&&(this._contextMenuSelect?AdfAgent.AGENT.getCapabilities()[AdfAgent.CAP_TOUCH_SCREEN]==AdfAgent.CAP_TOUCH_SCREEN_NONE||this._selIsSelected(b)||(this.suppressSelectionEventDelivery(!0),this._selUnselectAll(),this.suppressSelectionEventDelivery(!1),this._selSelectRow(b,d)):(this._isMultipleRowSelect()||this._unhiglightAnyExistingHighlightedRow(),
this._selHighlightRow(d),this._highlightedRowKey=b,this._highlightedRow=d),d=this.getComponent().getClientId(),AdfObject.ensureClassInitialization(AdfDhtmlCommandMenuItemPeer),h[AdfMenuUtils.AFR_TARGETROWCURRENCY]=b,h[AdfMenuUtils.AFR_TARGETCOMPONENTID]=d,g={component:this.getComponent(),rowKey:b},AdfPage.PAGE.scheduleTimer(null,AdfDhtmlTableBasePeer._setHighlightedRowKey,g,10),AdfDhtmlTableBasePeer._setHighlightedRowKey(g),this._contextMenuClosedCallback||(this._contextMenuClosedCallback=this.createCallback(this._contextMenuClosed)),
this._contextMenuOpenedCallback||(this._contextMenuOpenedCallback=this.createCallback(this._contextMenuOpened)),h._afrTableListenerSet||(h.addEventListener(AdfPopupOpenedEvent.POPUP_OPENED_EVENT_TYPE,this._contextMenuOpenedCallback),h.addEventListener(AdfPopupClosedEvent.POPUP_CLOSED_EVENT_TYPE,this._contextMenuClosedCallback),h._afrTableListenerSet=!0),h.isPopupVisible()&&(h.hide(),this._ignoreContextMenuClose=!0),this.showContextMenu(a,l,k,e,f,d),AdfAgent.AGENT.eatEvent(a))};
AdfDhtmlTableBasePeer.prototype.ContextMenuOpened=function(a,b){};AdfDhtmlTableBasePeer.prototype.ContextMenuClosed=function(a,b){};
AdfDhtmlTableBasePeer.prototype._contextMenuOpened=function(a){this._rowContextMenuVisible=!0;var b=a.getSource();if(!this._contextMenuSelect){var d=this._getRowContextMenuAndContainer(this._highlightedRowKey).popup;null!=d&&b.getClientId()==d.getClientId()&&(this._isMultipleRowSelect()||this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UNSELECT,!1))}this.ContextMenuOpened(a,b)};
AdfDhtmlTableBasePeer.prototype._contextMenuClosed=function(a){if(this._ignoreContextMenuClose)delete this._ignoreContextMenuClose;else{delete this._rowContextMenuVisible;var b=a.getSource();if(!this._contextMenuSelect){var d=this._getRowContextMenuAndContainer(this._highlightedRowKey).popup;null!=d&&b.getClientId()==d.getClientId()&&(this._grabFocus(),this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE,!1),this._unhiglightAnyExistingHighlightedRow())}delete b[AdfMenuUtils.AFR_TARGETROWCURRENCY];
delete b[AdfMenuUtils.AFR_TARGETCOMPONENTID];AdfPage.PAGE.scheduleTimer(null,AdfDhtmlTableBasePeer._clearHighlightedRowKey,this.getComponent(),10);this.ContextMenuClosed(a,b)}};AdfDhtmlTableBasePeer._clearHighlightedRowKey=function(a){a.setProperty("_highlightedRowKey",null,!1,AdfUIComponent.PROPAGATE_ALWAYS)};AdfDhtmlTableBasePeer._setHighlightedRowKey=function(a){a.component.setProperty("_highlightedRowKey",a.rowKey,!1,AdfUIComponent.PROPAGATE_ALWAYS)};
AdfDhtmlTableBasePeer.prototype.ProcessPushData=function(a,b){if(this._virtInitialized||this.IsEmpty)if(this._activeDataCount>=b)AdfPage.PAGE.addPartialTargets(this.getComponent());else{this._activeDataCount=b;this._payloadEvaluator||(this._payloadEvaluator=function(a){return a});for(var d=this._payloadEvaluator(a),e=0;e<d.length;e++){var f=d[e];this.IsFetchPending()?(f.id=b,this._getActiveMessageBuffer().push(f)):this._processActiveMessage(f)}this.IsFetchPending()||this._resetTwinkledCellStyling();
d=this.GetDataBody();this._fillViewPort(d,d.offsetHeight,!1);d=null;return!0}};
AdfDhtmlTableBasePeer.prototype._processActiveMessage=function(a){var b,d,e=a.type;switch(e){case "update":d=this.UpdateActiveRow(a);break;case "remove":d=this.RemoveActiveRow(a);break;case "insertBefore":case "insertAfter":case "insertInside":d=this.InsertActiveRow(a,e);break;default:AdfAssert.assert(!1,"Unknown ADS type:"+e),b=AdfDhtmlTableBasePeer.RERENDER_CONTAINER}d&&(b=d.rerender,this._announceActiveDataUpdate(e,d.updates));b&&AdfPage.PAGE.addPartialTargets(this.getComponent())};
AdfDhtmlTableBasePeer.prototype.IsValidAnnouncement=function(a,b,d){var e=b.getAttribute(a,"aria-live")||"",e=e.toLowerCase();if(""!==e)return!1;a=b.getAttribute(a,"aria-relevant")||"";a=a.toLowerCase().trim();b=a.split(" ");if(-1<b.indexOf("all"))return!0;e=!1;switch(d){case "update":if(""===a||-1<b.indexOf("text"))e=!0;break;case "remove":-1<b.indexOf("removals")&&(e=!0);break;case "insertBefore":case "insertAfter":case "insertInside":if(""===a||-1<b.indexOf("additions"))e=!0}return e};
AdfDhtmlTableBasePeer.prototype._announceActiveDataUpdate=function(a,b){if(b&&""!==b){var d=this.getDomElement(),e=AdfAgent.AGENT;if(d&&this.IsValidAnnouncement(d,e,a)){var e=AdfPage.PAGE.getLookAndFeel(),f=this.getComponent(),d=f.getAccessibleName();null==d&&(d="",AdfLogger.LOGGER.fine("No shortDesc exists for the component with clientId: ",f.getClientId()));f=this.GetActiveDataAnnouncementKey(a);e=e.getTranslatedString(f);e=TrFastMessageFormatUtils.format(e,d,b);this._twinkledCellAnnouncements=
this._twinkledCellAnnouncements+" "+e}}};AdfDhtmlTableBasePeer.prototype.GetActiveDataAnnouncementKey=function(a){return AdfDhtmlTableBasePeer.msgMap[a]||"AFActiveDataTableRowInsert"};AdfDhtmlTableBasePeer.prototype.RegisterADSAccessibility=function(){};AdfDhtmlTableBasePeer.prototype._getActiveMessageBuffer=function(){this._activeMessageBuffer||(this._activeMessageBuffer=[]);return this._activeMessageBuffer};
AdfDhtmlTableBasePeer.prototype._resetActiveMessageBuffer=function(){this._activeMessageBuffer=null};AdfDhtmlTableBasePeer.prototype._applyBufferedADSEvents=function(a,b){if(-1!=a){var d=this._activeMessageBuffer;if(d)for(var e=0;e<d.length;e++){var f=d[e],g=f.id;(b?g<=a:g>a)&&this._processActiveMessage(f)}this._resetTwinkledCellStyling()}};
AdfDhtmlTableBasePeer.prototype.IsInsertAllowed=function(a){var b=!0,d=this.GetDataBody().childNodes,e=d[0],d=d[d.length-1];this._pendingFetch==AdfTableDataFetchEvent.AFTER_KEY_SUBTYPE?a==d.startRow+d.numRows&&(b=!1):this._pendingFetch==AdfTableDataFetchEvent.BEFORE_KEY_SUBTYPE?a==e.startRow&&(b=!1):void 0==this._pendingFetch&&a!=d.startRow+d.numRows&&(a<e.startRow||a>=d.startRow+d.numRows)&&(b=!1);return b};
AdfDhtmlTableBasePeer.prototype._findADSInsertLocation=function(a,b,d){var e=-1;if("insertBefore"==b)if(a){if(a=this.FindRowByKey(a))e=a.index}else a=d[d.length-1],b=this.GetRowCount(),-1!=b&&a.startRow+a.numRows==b&&(e=b);else a?(a=this.FindRowByKey(a))&&(e=a.index+1):0==d[0].startRow&&(e=0);return e};
AdfDhtmlTableBasePeer.prototype.InsertClonedRow=function(a,b,d){var e=a.cloneNode(!0);this._cleanClonedRow(e,d);e.setAttribute(AdfDhtmlTableBasePeer._ROW_KEY,d);AdfDomUtils.removeCSSClassName(e,AdfDhtmlTableBasePeer._SELECTED_CLASS);AdfDomUtils.removeCSSClassName(e,AdfDhtmlTableBasePeer._HIGHLIGHTED_CLASS);AdfDomUtils.removeCSSClassName(e,AdfDhtmlTableBasePeer._FOCUSED_CLASS);a=a.parentNode.parentNode.cloneNode(!1);d=this.getDomDocument().createElement("TBODY");d.appendChild(e);a.appendChild(d);this.InsertBlock(a,
b,1,1,0);return e};AdfDhtmlTableBasePeer.prototype.InsertClonedComponents=function(a,b){var d=AdfAgent.AGENT.getDescendantComponentsForNode(a);if(d)for(var e=d.length,f=0;f<e;f++){var g=d[f],h=g.getClientId(),h=this._fixClonedClientId(h,b);g.clone(h).AddNotify()}};
AdfDhtmlTableBasePeer.prototype.InsertActiveRow=function(a,b){var d,e=null;this.IsEmpty||(e=this.GetDataBody().childNodes);if(e&&0<e.length){var f=this._findADSInsertLocation(a.iKey,b,e);if(-1!=f&&this.IsInsertAllowed(f)){var g=a.rKey,e=this.GetTemplateRow(e);this.InsertClonedRow(e,f,g);this.InsertClonedComponents(e,g);renderer=this.UpdateActiveRow(a).rerender}else d=AdfDhtmlTableBasePeer.RERENDER_CONTAINER_CHILDREN}else d=AdfDhtmlTableBasePeer.RERENDER_CONTAINER_CHILDREN;f=this.GetActiveRowText(a.rKey,
b);return{rerender:d,updates:f}};AdfDhtmlTableBasePeer.prototype.GetTemplateRow=function(a){a=a[0].rows;AdfAssert.assert(a&&a[0],"Unable to insert active row when the block contains no rows to clone!");return a[0]};
AdfDhtmlTableBasePeer.prototype.RemoveActiveRow=function(a){var b="";if(!this.IsEmpty){var d=this.FindRowByKey(a.rKey);if(d){var e=d.tr,b=this.GetActiveRowText(a.rKey,"remove");AdfAgent.AGENT.elementsRemoved(e);this.DeleteBlock(d.index,1,1,0,null);AdfPage.PAGE.removeComponentsInSubtree(e)}}return{rerender:"",updates:b}};AdfDhtmlTableBasePeer.prototype.MaxOfRerender=function(a,b){if(a===b)return a;var d=AdfDhtmlTableBasePeer._RERENDER_PRIORITY,e=d[a],d=d[b];return e?d?e>=d?a:b:a:b};
AdfDhtmlTableBasePeer.prototype.UpdateActiveRow=function(a){var b="",d=a.type;if(!this.IsEmpty){a=a.updates;for(var e="",f=0;f<a.length;f++)var g=a[f],g=this._applyActiveDataUpdate(g.cliId,g.callback,g.properties,g.formattedProperties,d),b=this.MaxOfRerender(b,g.result),e=e+" "+g.update,e=e.trim()}return{rerender:b,updates:e}};AdfDhtmlTableBasePeer.prototype._cleanClonedRow=function(a,b){for(var d=0;d<this._colCount;d++){var e=this.FindCellByIndex(a,d);this._fixElementIds(e,b)}AdfAgent.AGENT.elementsAdded(a)};
AdfDhtmlTableBasePeer.prototype._fixElementIds=function(a,b){a.id=this._fixClonedClientId(a.id,b);for(var d=a.firstChild;d;)1==d.nodeType&&this._fixElementIds(d,b),d=d.nextSibling};AdfDhtmlTableBasePeer.prototype._fixClonedClientId=function(a,b){var d="";if(a){for(var e=a.split(":"),f=0;f<e.length-2;f++)d+=e[f],d+=":";d=d+(b+":")+e[e.length-1]}return d};AdfDhtmlTableBasePeer.prototype.IsNodeStampCell=function(a){return!1};
AdfDhtmlTableBasePeer.prototype._applyActiveDataUpdate=function(a,b,d,e,f){b=AdfAgent.AGENT.getElementById(a);if(!b)return{result:!1,update:""};b=this._findCellContainingChild(b);if(!b)return{result:!1,update:""};d=b.textContent;this._markAsActive(b,a);if(a=AdfPage.PAGE.findComponent(a)){fp=e;for(p in fp)a.setProperty(p,fp[p],!1,AdfUIComponent.PROPAGATE_LOCALLY);e=void 0}else e="RERENDER_CELL";f=this.GetUpdatedActiveValues(b,f,d);return{result:e,update:f}};
AdfDhtmlTableBasePeer.prototype.GetUpdatedActiveValues=function(a,b,d){d="";if("update"!==b)return d;var e=this.getDomElement();if(!e||!this.IsValidAnnouncement(e,AdfAgent.AGENT,b))return d;d=this.GetRowHeaderText(a,e);d.trim();if(""===d)return d;b=this.GetColHeaderText(a);a=a.textContent;e=AdfPage.PAGE.getLookAndFeel().getTranslatedString("AFActiveDataTableRowUpdateInfo");return e=TrFastMessageFormatUtils.format(e,d,b,a)};
AdfDhtmlTableBasePeer.prototype.GetActiveRowText=function(a,b){var d="",e=this.getDomElement(),f=AdfAgent.AGENT;return e&&this.IsValidAnnouncement(e,f,b)?d=this.GetRowText(a,e,f):d};
AdfDhtmlTableBasePeer.prototype.GetRowText=function(a,b,d){var e="";try{var f=this.FindRowByKey(a).tr.cells;if(this.IsWholeRowRead(b,d)){var g=f.length;for(a=0;a<g;a++)e=e+f[a].textContent+" "}else e=f[0].textContent;return e=e.trim()}catch(h){return AdfLogger.LOGGER.fine("Exception while trying to get the announcement text for the active data row insert/delete"+h),e}};
AdfDhtmlTableBasePeer.prototype.IsWholeRowRead=function(a,b){var d=b.getAttribute(a,"data-aria-read-whole-row")||"",d=d.toLowerCase().trim();return"true"===d?!0:!1};AdfDhtmlTableBasePeer.prototype.GetRowHeaderText=function(a,b){try{return(cells=this.GetRowKeyAndRow(a,b)[1].cells[0]).textContent}catch(d){return AdfLogger.LOGGER.fine("Exception while trying to get the header text of active row:"+d),""}};
AdfDhtmlTableBasePeer.prototype.GetColHeaderText=function(a){try{if(this._headerless)return"";var b=this._getCellIndex(a);return this._getColumnHeaderLeafCell(b).textContent}catch(d){return AdfLogger.LOGGER.fine("Exception while trying to get the column header text of active row:"+d),""}};
AdfDhtmlTableBasePeer.prototype._markAsActive=function(a,b){a&&(AdfDomUtils.addCSSClassName(a,AdfDhtmlTableBasePeer._TWINKLE_ON_STYLE_CLASS),AdfDomUtils.removeCSSClassName(a,AdfDhtmlTableBasePeer._TWINKLE_OFF_STYLE_CLASS),this._twinkledCells.push(b))};AdfDhtmlTableBasePeer.prototype._resetTwinkledCellStyling=function(){AdfPage.PAGE.announceToAssistiveTechnology(this._twinkledCellAnnouncements);window.setTimeout(AdfDhtmlTableBasePeer._cleanUpAdsNodes,1E3,this)};
AdfDhtmlTableBasePeer._cleanUpAdsNodes=function(a){if(a.getDomElement())for(var b=a._twinkledCells.length,d=0;d<b;d++){var e=AdfAgent.AGENT.getElementById(a._twinkledCells[d]);e&&(e=a._findCellContainingChild(e))&&(AdfDomUtils.removeCSSClassName(e,AdfDhtmlTableBasePeer._TWINKLE_ON_STYLE_CLASS),AdfDomUtils.addCSSClassName(e,AdfDhtmlTableBasePeer._TWINKLE_OFF_STYLE_CLASS))}delete a._twinkledCells;delete a._twinkledCellAnnouncements;a._twinkledCells=[];a._twinkledCellAnnouncements=""};
AdfDhtmlTableBasePeer.prototype.FindRowByKey=function(a){for(var b=null,d=this.GetDataBody().childNodes,e=0;e<d.length&&!b;e++){var f=d[e],g=f.rows;if(g)for(var h=0,k=0;h<g.length&&!b;h++){var l=g[h],m=l.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY);if(m){if(a==m){b={tr:l,index:f.startRow+k,block:f};break}++k}}}return b};
AdfDhtmlTableBasePeer.prototype.FindCellByIndex=function(a,b){AdfAssert.assert(null!=a,"Unable to find cell by index if the given row is invalid!");var d=null,d=null;this._freezeColumnsToStart()&&!this._isColumnFrozen(b)?(d=this._getNestedScrolledTable(a),d=d.rows[0].cells[b-this._lastFrozen-1]):this._freezeColumnsToEnd()?this._isColumnFrozen(b)?d=0<this._firstFrozen?a.cells[b-this._firstFrozen+1]:a.cells[b]:(d=this._getNestedScrolledTable(a),d=d.rows[0].cells[b]):d=a.cells[b];return d};
AdfDhtmlTableBasePeer.prototype._findCellContainingChild=function(a){for(var b=AdfAgent.AGENT;a&&"TD"!==b.getNodeName(a);)a=a.parentNode;return a};
AdfDhtmlTableBasePeer.prototype._getColumnFlex=function(a,b,d,e,f){if(!a)return null;if("multiple"==d)return e=b,null==e&&(e=""+a.getWidth()),a=e.length-1,"%"!=(""+e).charAt(a)?null:Math.abs(parseInt(e.substring(0,a)));if("last"==d){if(b=a.getDisplayIndex(),-1==b&&(b=f),b==e-1&&!a.getRowHeader())return 1}else if(b=this._stretchedColumnId,null!=b&&(d=a.getClientId(),d.substring(1+d.lastIndexOf(":"))==b&&(b=a.getDisplayIndex(),-1==b&&(b=f),!a.getRowHeader()&&(!this._isColumnFrozen(b)||this._freezeColumnsToEnd()&&
b==e-1))))return 1;return null};AdfDhtmlTableBasePeer.prototype._getColumnActualWidth=function(a,b){var d=100,e=!1,f;f=this.IsEmpty?this._getColumnHeaderFooterSizingCell(a,this.__getColumnHeader(),"t","d2","t2"):this.FindCellByIndex(b,a);try{var g=AdfAgent.AGENT.getComputedStyle(f).width,d=parseInt(g);if(isNaN(d)||0>d)if(d=parseInt(f.style.width),isNaN(d)||0>d)d=100,e=!0}catch(h){d=100,e=!0}e&&AdfLogger.LOGGER.warning("INVALID COLUMN WIDTH FOR COLUMN DISPLAY INDEX: "+a);return d};
AdfDhtmlTableBasePeer.prototype._stretchTheColumns=function(){var a=this._columnStretching;if(null!=a&&"none"!=a&&!(this._nothingFlexible||this.IsEmpty&&this._headerless)){this._stretchingTheColumns=!0;try{this._doColumnStretching(a)}finally{delete this._stretchingTheColumns}}};
AdfDhtmlTableBasePeer.prototype._doColumnStretching=function(a,b){var d,e,f,g,h,k=AdfAgent.AGENT,l=0,m=this.__getVisibleLeafColumns();e=m.length;f=Array(e);g=Array(e);h=Array(e);for(var n=!0,q=0;q<e;q++){var r=m[q];d=this._getColumnFlex(r,null,a,e,q);null!=d&&(n=!1,f[q]=d,d=""+r.getWidth(),d.lastIndexOf("%")==d.length-1&&(h[q]=d.substring(0,d.length-1),l+=Math.abs(parseInt(h[q]))),g[q]=isNaN(d)?r.getMinimumWidth():d)}if(n)this._nothingFlexible=!0;else{if("multiple"==a)for(x=0;x<h.length;x++)h[x]/=
l;l=this._colCount;n=this.GetDataBody();d=n.childNodes[0];h=!1;var t;this.IsEmpty||(t=d.rows[0],AdfAssert.assert(null!=t,"this.IsEmpty was "+this.IsEmpty+" but there were no rows!"));m=0;!this._hasFrozenColumn()||this._areAllColumnsFrozen(l)?(l=n.offsetWidth,d=this.IsEmpty?this.__getColumnHeader().firstChild.offsetWidth:d.offsetWidth,m=l-d):this.IsEmpty?(l=this.__getColumnHeader(),d=AdfDhtmlTableBasePeer.__getChildBySubId(l,"t"),m=AdfDhtmlTableBasePeer.__getChildBySubId(l,"d2"),m=AdfDhtmlTableBasePeer.__getChildBySubId(m,
"t2"),l=l.parentNode.offsetWidth,m=l-d.offsetWidth-m.offsetWidth-2):(d=this._getNestedScrolledTable(t),this._freezeColumnsToEnd()?(l=this.__getColumnHeader(),d=AdfDhtmlTableBasePeer.__getChildBySubId(l,"t"),m=AdfDhtmlTableBasePeer.__getChildBySubId(l,"d2"),m=AdfDhtmlTableBasePeer.__getChildBySubId(m,"t2"),l=l.parentNode.offsetWidth,n=this._getScrollbarWidth(),m=l-d.offsetWidth-m.offsetWidth-n-2):(l=d.parentNode.offsetWidth,m=l-d.offsetWidth));if(0!=m||!this._virtInitializedComplete){l=[];for(q=n=
0;q<e;q++)d=f[q],null!=d&&(r=this._getColumnActualWidth(q,t),n+=r,l.push({displayIndex:q,flex:d,minimumWidth:g[q],width:r}));t=n+m;e=l.length;var u;d=!1;for(m=0;!d&&m<e;){n=t;for(f=q=0;f<e;f++)u=l[f],u.atMinimum?(g=u.minimumWidth,n-=g):q+=u.flex;var r=n,v=0;for(f=0;f<e;f++)if(u=l[f],!u.atMinimum){var w=u.flex/q*r;g=Math.floor(w);minimumWidth=u.minimumWidth;g<minimumWidth?(g=minimumWidth,u.atMinimum=!0,m++):v+=w-g;u.calculatedWidth=g;n-=g}v=Math.round(v);n==v&&(0<v&&(u.calculatedWidth+=v),d=!0)}t=
[];for(f=0;f<e;f++)u=l[f],d=u.displayIndex,g=u.calculatedWidth,t.push({displayIndex:d,width:g}),u=g-u.width,0==u&&this._virtInitializedComplete||(h=!0,this._doResizeColumn(d,null,g,u,!1));this.IsEmpty||k.getPlatform()!=AdfAgent.GECKO_PLATFORM&&k.getPlatform()!=AdfAgent.WEBKIT_PLATFORM||this.alignColGroupWidths();this._currentColumnStretchDetails=t}h&&(b||(b=0),5>b&&this._doColumnStretching(a,++b))}};
AdfDhtmlTableBasePeer.prototype.alignColGroupWidths=function(){if(!this._headerless){var a=this.__getColumnHeader();if(a=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"TABLE")){var b=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"COLGROUP");if(b)var d=b.children}}for(var e=this.GetDataBody().childNodes,f=0;f<e.length;f++){var g=e[f];if(g&&a&&(g=AdfDhtmlTableBasePeer.FindFirstChildByTagName(g,"COLGROUP"))&&b&&(g=g.children,g.length==d.length))for(var h=0;h<g.length;h++){var k=parseInt(g[h].style.width),
l=parseInt(d[h].style.width);k>l&&(d[h].style.width=k+"px");l>k&&(g[h].style.width=l+"px")}}};
AdfDhtmlTableBasePeer.prototype._stretchLastBlockColumn=function(a){var b;if(-1!=this._lastColWidthOverride){var d=this._colCount-1;AdfAssert.assert(null!=a.rows,"Unable to stretch the columns in the last fetched block because it contains no rows!");b=this.FindCellByIndex(a.rows[0],d);b=parseInt(b.style.width);this._resizeBlockColumn(a,d,this._lastColWidthOverride-b)}else if(null!=this._currentColumnStretchDetails){AdfAssert.assert(null!=a.rows,"Unable to stretch the columns in the last fetched block because it contains no rows!");
for(var d=this._currentColumnStretchDetails,e=d.length,f=0;f<e;f++){var g=d[f],h=g.displayIndex;b=this.FindCellByIndex(a.rows[0],h);b=parseInt(b.style.width);this._resizeBlockColumn(a,h,g.width-b)}}};
AdfDhtmlTableBasePeer.prototype._collectClientTokens=function(a){for(var b="",d=this.GetDataBody().childNodes,e=0;e<d.length;e++)for(var f=d[e].rows,g=0;g<f.length;g++){var h=f[g].getAttribute(AdfDhtmlTableBasePeer._ROW_KEY);if("flat"==a)b+=h,b+="_";else for(var h=h.split(","),k=h.length,b=b+h[k-1],b=b+"_",l=0;l<k-1;l++){var m=h[l];b.match(new RegExp("(^|_)"+m+"(_|$)"))||(b+=m,b+="_")}}return b};
AdfDhtmlTableBasePeer.prototype._grabFocus=function(){if(this.isInActiveHeirarchy()){var a=AdfPage.PAGE.getActiveDomElement();a&&this.getDomElement()!=a&&a.blur&&(a.blur(),AdfFocusUtils.focusElement(this.getDomElement()))}else AdfFocusUtils.focusElement(this.getDomElement())};
AdfDhtmlTableBasePeer.prototype.HandleComponentFocus=function(a){if(this._virtInitialized){if(void 0!=a.getNativeEventTarget){var b=a.getNativeEventTarget();b&&(this._getNavigationBar()&&this._getNavigationBar().contains(b)||this.__getElemBySubId("hscroller")&&this.__getElemBySubId("hscroller").contains(b))?this._avoidSettingFocusOnColumnHeader=!0:this._avoidSettingFocusOnColumnHeader=!1;if(b!=this.getDomElement()&&this._isTargetCellEditable(b)){var d=this.getComponent().getClientId(),e=a.getSource();
if(e&&e.getClientId()!=d&&e.getParent()&&e.getParent().getClientId()!=d)return;this._unclipInputElem(b);void 0==b.value||"TEXTAREA"!=b.nodeName&&"text"!=b.type&&"select-one"!=b.type||(b._afrOldValue=b.value);"INPUT"==b.nodeName&&"text"==b.type&&AdfPage.PAGE.scheduleTimer(this,this._selectInputOnMouseUp,b,0)}}null!=this._blurTimeout&&(clearTimeout(this._blurTimeout),delete this._blurTimeout);a.getEventPhase()!=AdfBaseEvent.BUBBLING_PHASE&&null==this._focusTimeout&&(null==this._focusTimeoutCallback&&
(this._focusTimeoutCallback=this.createCallback(this._doFocusTimeout)),this._focusTimeout=setTimeout(this._focusTimeoutCallback,10))}};AdfDhtmlTableBasePeer.prototype.HandleComponentBlur=function(a){null==this._blurTimeoutCallback&&(this._blurTimeoutCallback=this.createCallback(this._doBlurTimeout));this._blurTimeout=setTimeout(this._blurTimeoutCallback,10)};
AdfDhtmlTableBasePeer.prototype.HandleHeaderlessFocus=function(){var a=null,b=null,d=null;if(a=this.GetLastRowKey()){var e=this.FindRowByKey(a);e?b=e.tr:a=null}null==a&&(e=this.GetFirstVisibleRowKeyAndRow())&&(a=e.rowKey,b=e.row,this._isRowSelectionEnabled()&&null!=a&&(this._selSelectRow(a,b),this._unclipRow(b)));b&&(d=this.FindCellByIndex(b,0));this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,a,b,d)};
AdfDhtmlTableBasePeer.prototype._doFocusTimeout=function(){if(this.getComponent()&&!this._rowContextMenuVisible){this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE,!1,null);var a=this._focusManager;a.domElement?this._updateFocusCellStyle(!0):a.objectType!=AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE&&a.objectType!=AdfDhtmlTableBasePeer._FILTER_CELL_FOCUS_TYPE&&(this._avoidSettingFocusOnColumnHeader||this._setFirstColumnHeaderFocus(!1,!0,!0)||this.HandleHeaderlessFocus(),this._avoidSettingFocusOnColumnHeader=
!1)}delete this._focusTimeout};AdfDhtmlTableBasePeer.prototype._doBlurTimeout=function(){this.getComponent()&&!this._rowContextMenuVisible&&(this._selUpdateAll(AdfDhtmlTableBasePeer._SEL_UPDATE_ALL_UPDATE,!1,null),this.isInActiveHeirarchy()||this._focusManager.domElement&&this._updateFocusCellStyle(!1));delete this._blurTimeout};
AdfDhtmlTableBasePeer.prototype._handleKeyboardSort=function(a){var b=this._focusManager;if(b.objectType==AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE){var b=b.domElement,d=b.id,e=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(d,AdfDhtmlTableBasePeer.__SORT_INDICATOR));if(e){var e=e.getAttribute(AdfDhtmlTableBasePeer._SORTED_TYPE),f=AdfPage.PAGE.findComponent(d).getSortProperty(),d=AdfDhtmlTableBasePeer.__getSortOrderForColumn(d);e!=a&&(d=a==AdfDhtmlTableBasePeer._SORTED_DESCENDING?!1:
!0,this.getComponent().setProperty("currentlySelectedHeaderId",b.id),AdfTableUtils.queueSortEvent(this.getComponent(),f,d))}}};AdfDhtmlTableBasePeer.prototype.HandleComponentKeyUp=function(a){a.isCanceled()||(a=AdfAgent.AGENT,a.enableUserSelect(a.getDomDocument().body))};AdfDhtmlTableBasePeer.prototype._disableTabStop=function(a){AdfDomUtils.disableTabStop(this.GetDataBody(),a);var b=this.__getColumnHeader();b&&AdfDomUtils.disableTabStop(b,a)};
AdfDhtmlTableBasePeer.prototype._enterReadOnlyMode=function(a,b){var d=a.getNativeEvent(),e=AdfAgent.AGENT,f=e.getEventTarget(d),g=!1;AdfDhtmlDialogManager.getInstance();if(this._reorderTH||this._resizedTH)g=!0;else if(!this._rowContextMenuVisible){this._isTargetCellEditable(f)&&void 0!=f._afrOldValue&&f.value!=f._afrOldValue&&b&&(f.value=f._afrOldValue);var h=this.GetFocusedRowKey();h&&h==this._getActiveRowKey()&&this._isClickToEdit()?(h=this.GetRowKeyAndRow(f,this.getDomElement()),null!=h&&null!=
h[0]&&(f=this._getCellAndIndexForNode(f,h[1]),this._lastCTEIndex=f.cellIndex,f.cell&&this._setActiveDescendant(f.cell,!1)),this._setActiveRowKey(null),this._disableTabStop(!0),this._editableTableReadOnlyMode=!0,this._grabFocus(),e.eatEvent(d)):this._isClickToEdit()?this._isTargetCellEditable(f)||(this._selUnselectAll(),this._queueColumnSelectionEvent()):(this._setReadOnlyMode(!0,f,!0),e.eatEvent(d))}return g};
AdfDhtmlTableBasePeer.prototype.HandleComponentKeyDown=function(a){if(!a.isCanceled()&&this.__isOwnComponentEvent(a)){var b=a.getNativeEvent(),d=AdfAgent.AGENT,e=d.getEventTarget(b),f=b.keyCode,g=!1,h=this._virtInitialized;switch(f){default:g=!0;break;case AdfKeyStroke.ESC_KEY:g=(g=AdfDhtmlDialogManager.getInstance().getActiveDialog())&&AdfDhtmlPopupWindow.isAncestorOrSelf(g._rootElement,a.GetSourceDomElement())&&!this._isTargetCellEditable(e)?!0:this._enterReadOnlyMode(a,!0);break;case AdfKeyStroke.M_KEY:b.ctrlKey&&
b.altKey&&h?this._handleKeyboardContextMenu(b,!0):g=!0;break;case AdfKeyStroke.A_KEY:b.ctrlKey&&!b.altKey&&h?(this._grabFocus(),e=this._isMultipleRowSelect(),f=this._isMultipleRowSelectNoSelectAll(),!e||f||this.getComponent().getSelectedRowKeys()[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]||this._selSelectAll()):g=!0;break;case AdfKeyStroke.END_KEY:!(g=this._isTargetCellEditable(e))&&b.ctrlKey&&b.shiftKey&&h&&this._handleCtrlShiftEnd(b);break;case AdfKeyStroke.PAGEUP_KEY:(g=this._isTargetCellEditable(e))||
this._handlePageUp(b.altKey,b.ctrlKey,b.shiftKey);break;case AdfKeyStroke.PAGEDOWN_KEY:(g=this._isTargetCellEditable(e))||this._handlePageDown(b.altKey,b.ctrlKey,b.shiftKey);break;case AdfKeyStroke.SPACE_KEY:case 192:h=d.getOS()==AdfAgent.MAC_OS&&192==f&&b.ctrlKey;(g=this._isTargetCellEditable(e))||(h||f==AdfKeyStroke.SPACE_KEY)&&this._handleSpaceKey(f,b);break;case AdfKeyStroke.ENTER_KEY:(g="TEXTAREA"==e.tagName||"A"==e.tagName)||(g=this._handleEnterKey(e,b));break;case AdfKeyStroke.HOME_KEY:!(g=
this._isTargetCellEditable(e))&&b.ctrlKey&&h&&this._scrollerScrollToPos(null,0);break;case AdfKeyStroke.F2_KEY:this._editableTableReadOnlyMode?this._exitReadOnlyMode(b):this._enterReadOnlyMode(a,!1);break;case AdfKeyStroke.TAB_KEY:this._isTargetCellEditable(e)?g=this._handleTabKey(e,b):AdfPage.PAGE.getActiveDomElement()!=this.getDomElement()||b.shiftKey?g=!0:(e=this._getActiveRowKey(),f=this.GetFocusedRowKey(),null!=e?0==e&&null==f&&this._isClickToEdit()?g=!0:(h=this.FindRowByKey(e),null!=h&&(null==
this._setFocusOnEditableElementInNode(d,h.tr)?g=!0:null==f&&this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,e,h.tr))):g=!0)}g||(a.stopBubbling(),d.eatEvent(b))}};
AdfDhtmlTableBasePeer.prototype._handleKeyboardContextMenu=function(a,b){var d=AdfAgent.AGENT,e=this._focusManager;if(e.objectType==AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE)this._handleColumnContextMenu(a,e.domElement);else if(d=d.getEventTarget(a),b||!this._isTargetCellEditable(d)){var d=this.ResolveContextMenuAlignElement(e.domElement),f=this.GetKeyboardContextMenuAlignHint();this.HandleRowContextMenu(a,e.currency,e.domElement,d,f)}};
AdfDhtmlTableBasePeer.prototype.GetKeyboardContextMenuAlignHint=function(){return null};AdfDhtmlTableBasePeer.prototype.ResolveContextMenuAlignElement=function(a){return a};
AdfDhtmlTableBasePeer.prototype._handleCtrlShiftEnd=function(a){var b=this._focusManager;a=b.objectType;b=b.currency;(a==AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE||a==AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE)&&(a=this.GetDataBody())&&0<a.childNodes.length&&a.childNodes[0].rows[0].getAttribute(AdfDhtmlTableBasePeer._ROW_KEY)==b&&(this._grabFocus(),this.getComponent().getSelectedRowKeys()[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]||this._selSelectAll())};
AdfDhtmlTableBasePeer.prototype._exitReadOnlyMode=function(a){var b=AdfAgent.AGENT;a=b.getEventTarget(a);if(this._isClickToEdit()){var d=this.GetFocusedRowKey(),e=this._getActiveRowKey();if(!e||d&&(e!=d||this.getComponent().getProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY))){if(b=d?d:this._getFirstRowKey())this._setActiveRowKey(b),this._editableTableReadOnlyMode&&(b=this._lastCTEIndex,this._setReadOnlyMode(!1,a,!1),void 0!=b&&(this._clickEditRequest={cellIndex:b}));return}}else!this._isClickToEdit()&&
this._editableTableReadOnlyMode&&this._setReadOnlyMode(!1,a,!0);this._isTargetCellEditable(a)&&(d=this.GetRowKeyAndRow(a,this.getDomElement()),null!=d&&(a=this._getCellAndIndexForNode(a,d[1]).cell,this._setInputElementCursorAtEndInNode(b,a)))};AdfDhtmlTableBasePeer._restoreSelectedItemOnArrowNav=function(a){a.elem.selectedIndex=a.index};
AdfDhtmlTableBasePeer.prototype._handleArrowKeyNavLeftRight=function(a,b,d,e){var f=null,g=AdfAgent.AGENT;if(a==AdfKeyStroke.ARROWRIGHT_KEY)for(a=this.__getVisibleLeafColumns().length,e+=1;e<a;){f=this.FindCellByIndex(b,e);f=this._setFocusOnEditableElementInNode(g,f);if(null!=f){this._dismissTargetPopupsOnArrowNav(d);break}e++}else for(--e;0<=e;){f=this.FindCellByIndex(b,e);f=this._setFocusOnEditableElementInNode(g,f);if(null!=f){this._dismissTargetPopupsOnArrowNav(d);break}e--}null!=f&&g.getPlatform()==
AdfAgent.GECKO_PLATFORM&&"SELECT"==f.nodeName&&"select-one"==f.type&&AdfPage.PAGE.scheduleTimer(null,AdfDhtmlTableBasePeer._restoreSelectedItemOnArrowNav,{index:f.selectedIndex,elem:f},0)};
AdfDhtmlTableBasePeer.prototype._handleArrowKeyNav=function(a,b,d){var e=this.GetRowKeyAndRow(b,this.getDomElement());if(null!=e){d=e[0];if(null!=d){var e=e[1],f=this._getCellAndIndexForNode(b,e).cellIndex;this._ctePatternStart=void 0;a==AdfKeyStroke.ARROWUP_KEY||a==AdfKeyStroke.ARROWDOWN_KEY?this._isClickToEdit()?this._clickToEditActivateRow(d,a==AdfKeyStroke.ARROWDOWN_KEY,f):this._setFocusOnEditableRowCell(d,a==AdfKeyStroke.ARROWDOWN_KEY,f):this._handleArrowKeyNavLeftRight(a,e,b,f)}return!1}return!0};
AdfDhtmlTableBasePeer.prototype._dismissTargetPopupsOnArrowNav=function(a){a=AdfRichUIPeer.getFirstAncestorComponent(a);a!=this.getComponent()&&a.getPeer().cancelAllPopups(a)};
AdfDhtmlTableBasePeer.prototype._handleArrow=function(a,b){switch(this._focusManager.objectType){case AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE:this._handleRowHeaderArrow(a,b);break;case AdfDhtmlTableBasePeer._FILTER_CELL_FOCUS_TYPE:this._handleFilterCellArrow(a,b);break;case AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE:this._handleColumnHeaderArrow(a,b);break;case AdfDhtmlTableBasePeer._COLUMN_FOOTER_FOCUS_TYPE:this._handleColumnFooterArrow(a,b);break;case AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE:a==
AdfKeyStroke.ARROWUP_KEY||a==AdfKeyStroke.ARROWDOWN_KEY?this._handleTableBodyArrowUpDown(a==AdfKeyStroke.ARROWUP_KEY,b.ctrlKey,b.shiftKey):a!=AdfKeyStroke.ARROWLEFT_KEY&&a!=AdfKeyStroke.ARROWRIGHT_KEY||this.HandleTableBodyArrowLeftRight(a==AdfKeyStroke.ARROWLEFT_KEY,b.ctrlKey,b.shiftKey);break;case AdfDhtmlTableBasePeer._SELECT_ALL_FOCUS_TYPE:this._handleSelectAllArrow(a,b)}};
AdfDhtmlTableBasePeer.prototype._handleRowHeaderArrow=function(a,b){if(a==AdfKeyStroke.ARROWDOWN_KEY||a==AdfKeyStroke.ARROWUP_KEY){var d=a==AdfKeyStroke.ARROWUP_KEY,e=this._focusManager,f=e.currency;delete this._lastRowKeyInView;e=d?this._getPreviousRowKeyAndRow(f):this._getNextRowKeyAndRow(f);if(e.isAtTop)this._setFirstColumnHeaderFocus(!1);else if(e.isAtButtom)f=this._getActiveCellIndex(),this._setIndexedColumnFooterFocus(!1,!1,-1==f?0:f);else{var g=e.lastRowKeyInView,f=e.rowKey;null!=f?(d=e.row,
g=this.GetRowHeaderCellFromRow(d),this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,f,g),this._unclipRow(d)):null!=g?(this.GetScroller(),f=this._currentScrollTop+(d?-this._averageRowHeight:this._averageRowHeight),0<f&&f<this._getScrollHeight()&&(this._lastRowKeyInView=g,this._selectionRequest=d?AdfDhtmlTableBasePeer._FOCUS_RH_ARROW_UP:AdfDhtmlTableBasePeer._FOCUS_RH_ARROW_DOWN,this._scrollerScrollToPos(null,f))):(e=d?this._getLastVisibleRowKeyAndRow():this.GetFirstVisibleRowKeyAndRow(),
null!=e.rowKey&&(g=this.GetRowHeaderCellFromRow(e.row),this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,e.rowKey,g),this._unclipRow(e.row)))}}else a==AdfKeyStroke.ARROWRIGHT_KEY?null!=this._focusManager.currency&&(e=this._focusManager,f=e.currency,d=e.domElement.parentNode,this._isRowSelectionEnabled()&&(this._selUnselectAll(),this._selSelectRow(f,d)),e=this._findNextCell(this._getActiveCellNode(),!1),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,f,d,e)):
a==AdfKeyStroke.ARROWLEFT_KEY&&null!=this._focusManager.currency&&this._changeActiveCell(!0)};
AdfDhtmlTableBasePeer.prototype._handleFilterCellArrow=function(a,b){switch(a){case AdfKeyStroke.ARROWRIGHT_KEY:var d=this._getNextColumnHeaderFocusElement(this._focusManager.domElement);d&&(this._unclipColumnElement(d),this._setHeaderCellFocus(d));break;case AdfKeyStroke.ARROWLEFT_KEY:if(d=this._getPrevColumnHeaderFocusElement(this._focusManager.domElement))this._unclipColumnElement(d),this._setHeaderCellFocus(d);break;case AdfKeyStroke.ARROWDOWN_KEY:if(d=this._focusManager.domElement)d=this._getCellIndex(d),
0<=d&&this._setIndexedColumnHeaderFocus(!1,!1,d)}};
AdfDhtmlTableBasePeer.prototype._handleColumnHeaderArrow=function(a,b){var d=b.ctrlKey,e=b.shiftKey,f=this._virtInitialized;switch(a){case AdfKeyStroke.ARROWRIGHT_KEY:if(f=this._getNextColumnHeaderFocusElement(this._focusManager.domElement))this._unclipColumnElement(f),!this.getComponent().getDisableColumnReordering()&&d&&e?this._reorderColumnThroughKeyboard(!1):(this._setHeaderCellFocus(f),e&&this._isMultipleColumnSelect()&&this._shiftSelectColumnsThroughKeyboard(f));break;case AdfKeyStroke.ARROWLEFT_KEY:if(f=
this._getPrevColumnHeaderFocusElement(this._focusManager.domElement))this._unclipColumnElement(f),!this.getComponent().getDisableColumnReordering()&&d&&e?this._reorderColumnThroughKeyboard(!0):this._setHeaderCellFocus(f)!=AdfDhtmlTableBasePeer._SELECT_ALL_FOCUS_TYPE&&e&&this._isMultipleColumnSelect()&&this._shiftSelectColumnsThroughKeyboard(f);break;case AdfKeyStroke.ARROWUP_KEY:case AdfKeyStroke.ARROWDOWN_KEY:var g=this._focusManager.domElement;if(g)if(d&&e)f&&this._handleKeyboardSort(AdfKeyStroke.ARROWUP_KEY==
a?AdfDhtmlTableBasePeer._SORTED_ASCENDING:AdfDhtmlTableBasePeer._SORTED_DESCENDING);else if(1<g.colSpan){if(f=AdfKeyStroke.ARROWUP_KEY==a?this._resolveImmediateParentColumn(g):this._resolveImmediateChildColumn(g))this._unclipColumnElement(f),this._setHeaderCellFocus(f)}else AdfKeyStroke.ARROWDOWN_KEY==a?(attrs=this.GetFirstVisibleRowKeyAndRow(),rowKey=attrs.rowKey,d=attrs.row,e=this._isMultipleRowSelect(),this._isRowSelectionEnabled()&&null!=rowKey&&(e||this._selUnselectAll(),this._selSelectRow(rowKey,
d),this._unclipRow(d)),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,rowKey,d)):this._setIndexedFilterCellFocus(this._getCellIndex(g))}};AdfDhtmlTableBasePeer.prototype._shiftSelectColumnsThroughKeyboard=function(a){if(this._anchorColumnHeader){var b=[],d=[],e=[],f=[];this._resolveColumns(b,d,this._anchorColumnHeader);this._resolveColumns(e,f,a);this._selUnselectAll();this._selectColumnRange(b,d,e,f)}};
AdfDhtmlTableBasePeer.prototype._reorderColumnThroughKeyboard=function(a){var b=this._focusManager.domElement;if(b&&null!=b.getAttribute(AdfDhtmlTableBasePeer._ROOT_COLUMN)){var d=null;if(a){d=this._getSiblingDomNode(b,!1);if(null==d){var e=AdfAgent.AGENT.getIntAttribute(b,"_d_index",-1);if(this._hasFrozenColumn()&&!this._isColumnFrozen(e)){var e=AdfDhtmlTableBasePeer.__getChildBySubId(this.__getColumnHeader(),"t"),f=this._isFilterable()?2:1;e&&e.rows&&0<e.rows[f].cells.length&&(d=e.rows[f].cells,
d=d[d.length-1])}}null!=d.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)&&(d=null)}else d=this._getSiblingDomNode(b,!0),null==d&&(e=AdfAgent.AGENT.getIntAttribute(b,"_d_index",-1),this._isColumnFrozen(e)&&(e=AdfDhtmlTableBasePeer.__getChildBySubId(this.__getColumnHeader(),"d2"),e=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t2"),f=this._isFilterable()?2:1,e&&e.rows&&0<e.rows[f].cells.length&&(d=e.rows[f].cells[0])));d&&(this._reorderTH=b,this._targetReorderTH=d,this._insertColumnAfter=a?AdfDhtmlTableBasePeer._isRTL()?
!0:!1:AdfDhtmlTableBasePeer._isRTL()?!1:!0,this._reorderId=this._reorderTH.id,this._reorderColumnComponentsWithoutAnimation(),this._reorderTH=this._targetReorderTH=null,delete this._insertColumnAfter)}};AdfDhtmlTableBasePeer.prototype._isFilterCell=function(a){return null!=a.getAttribute(AdfDhtmlTableBasePeer._FILTER_COLUMN)};
AdfDhtmlTableBasePeer.prototype._getNextColumnHeaderFocusElement=function(a){var b=AdfAgent.AGENT;if(a){if(1<a.colSpan)return this._resolveImmediateChildColumn(a);for(var d=this._getSiblingDomNode(a,!0),e=this._resolveImmediateParentColumn(a),f=e;!d&&f;)f=null!=(d=this._getSiblingDomNode(e,!0))?this._resolveImmediateParentColumn(d):null;if(d)return(d?this._resolveImmediateParentColumn(d):null)!=e&&(e=this._resolveImmediateParentColumn(d))&&!this._isTargetCellFilter(e)?e:d;b=b.getIntAttribute(a,"_d_index",
-1);if(this._hasFrozenColumn()&&this._isColumnFrozen(b)&&(b=this.__getColumnHeader(),b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"d2"),b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"t2"),a=this._isFilterCell(a)?1:this._isFilterable()?2:1,b&&b.rows&&0<b.rows[a].cells.length))return b.rows[a].cells[0]}return null};
AdfDhtmlTableBasePeer.prototype._getPrevColumnHeaderFocusElement=function(a){var b=AdfAgent.AGENT;if(a&&null==a.getAttribute("_afrFH")){for(var d=this._isFilterCell(a),e=this._getSiblingDomNode(a,!1),f=this._resolveImmediateParentColumn(a),g=e?this._resolveImmediateParentColumn(e):null,h=f;!e&&h;)h=null!=(e=this._getSiblingDomNode(f,!1))?this._resolveImmediateParentColumn(e):null;if(null!=f&&f!=g&&!this._isTargetCellFilter(f))return f;if(null!=e)return this._resolveBotttomMostChildColumn(e);a=b.getIntAttribute(a,
"_d_index",-1);if(this._hasFrozenColumn()&&!this._isColumnFrozen(a)){if(a=this.__getColumnHeader(),(a=AdfDhtmlTableBasePeer.__getChildBySubId(a,"t"))&&a.rows&&(d=d?1:this._isFilterable()?2:1,d=a.rows[d].cells,a=d.length,0<a))return this._resolveBotttomMostChildColumn(d[a-1])}else this._hasFrozenColumn()&&this._setFirstColumnHeaderFocus(!0,!1,d)}return null};
AdfDhtmlTableBasePeer.prototype._getSiblingDomNode=function(a,b){for(var d=b?a.nextSibling:a.previousSibling;d&&1!=d.nodeType;)d=b?d.nextSibling:d.previousSibling;return d};
AdfDhtmlTableBasePeer.prototype._resolveBotttomMostChildColumn=function(a){var b=a;if(1<a.colSpan){var d=a;AdfAssert.assert(null!=d,"Table peer cannot resolve the bottom-most child column if the parent is null!");b=this._resolveImmediateChildColumn(a);for(a=b=this._resolveRightMostSiblingInGroup(d,b);null!=a;)d=a,null!=(a=this._resolveImmediateChildColumn(a))&&(b=a=this._resolveRightMostSiblingInGroup(d,a))}return b};
AdfDhtmlTableBasePeer.prototype._resolveRightMostSiblingInGroup=function(a,b){AdfAssert.assert(null!=a,"Table peer cannot resolve the right-most sibling in a group if the parent is null!");if(1<a.colSpan)for(var d=b,e=a.colSpan;d&&e>d.colSpan;)e-=d.colSpan,null!=(d=this._getSiblingDomNode(d,!0))&&(b=d);return b};
AdfDhtmlTableBasePeer.prototype.__getParentColumn=function(a){AdfAssert.assertPrototype(a,AdfRichColumn);return!this._headerless&&(a=this._resolveImmediateParentColumn(a.getPeer().getDomElement()))?AdfPage.PAGE.findComponent(a.id):null};
AdfDhtmlTableBasePeer.prototype._resolveImmediateParentColumn=function(a){var b=a.parentNode,d,e=null,f=b.parentNode.parentNode.rows,g=f.length,h=AdfAgent.AGENT;a=h.getIntAttribute(a,"_d_index",-1);for(var k=0;k<g;k++)if(f[k]==b){d=k-1;break}if(0<=d)for(k=d,b=!1;0<=k&&!b;k--)for(d=f[k].cells,g=d.length-1;0<=g;g--){var l=d[g],m=h.getIntAttribute(l,"_d_index",-1);if(1<=l.colSpan&&m<=a&&m+l.colSpan>=a){e=l;b=!0;break}}return e};
AdfDhtmlTableBasePeer.prototype._resolveImmediateChildColumn=function(a){var b=AdfAgent.AGENT,d=b.getIntAttribute(a,"_d_index",-1),e=a.parentNode,f;a=null;for(var g=e.parentNode.parentNode.rows,h=g.length,k=h-1;0<=k;k--)if(g[k]==e){f=k+1;break}if(f<h)for(k=f,f=!1;k<h&&!f;k++)for(var e=g[k].cells,l=e.length,m=0;m<l;m++){var n=e[m];if(d==b.getIntAttribute(n,"_d_index",-1)){a=n;f=!0;break}}return a};
AdfDhtmlTableBasePeer.prototype._unclipColumnElement=function(a){var b=AdfAgent.AGENT;if(this.IsEmpty){var d=this.getDomElement(),e=0;this._hasFrozenColumn()&&(e=AdfDhtmlTableBasePeer.__getChildBySubId(this.__getColumnHeader(),"t").offsetWidth);a.offsetLeft+a.offsetWidth+e>d.clientWidth+d.offsetLeft&&b.setScrollLeft(d,a.offsetWidth+a.offsetLeft+e-d.clientWidth);d.offsetLeft>a.offsetLeft+e&&b.setScrollLeft(d,a.offsetLeft+e)}else b=this.GetDataBody(),a.offsetLeft+a.offsetWidth>b.clientWidth+this.__getScrollLeft()-
this._frozenWidth?this._scrollerScrollToPos(a.offsetWidth+a.offsetLeft-b.clientWidth+this._frozenWidth,null):this.__getScrollLeft()>a.offsetLeft&&this._scrollerScrollToPos(a.offsetLeft,null)};
AdfDhtmlTableBasePeer.prototype._handleSelectAllArrow=function(a,b){switch(a){case AdfKeyStroke.ARROWUP_KEY:this._isFilterable()&&this._setFirstColumnHeaderFocus(!1,!0,!0);break;case AdfKeyStroke.ARROWDOWN_KEY:var d=this.GetDataBody().childNodes;if(0<d.length&&(d=d[0].rows[0])){var e=d.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),f=this.GetRowHeaderCellFromRow(d);this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,e,f);this._unclipRow(d)}break;case AdfKeyStroke.ARROWRIGHT_KEY:e=this.__getColumnHeader(),
f=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t"),AdfAssert.assertDomNode(f),d=this._isFilterable()?2:1,f.rows&&1<f.rows[d].cells.length?this._setHeaderCellFocus(f.rows[d].cells[1]):(e=AdfDhtmlTableBasePeer.__getChildBySubId(e,"d2"),f=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t2"),f.rows&&1<f.rows[d].cells.length&&this._setHeaderCellFocus(f.rows[d].cells[0]))}};
AdfDhtmlTableBasePeer.prototype._setFirstColumnHeaderFocus=function(a,b,d){if(!this._headerless){var e=this.__getColumnHeader();if(null==e)return!1;e=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t");d=d?1:this._isFilterable()?2:1;d=e.rows[d].cells[0];if((e=null!=d.getAttribute(AdfDhtmlTableBasePeer._SELECT_ALL))||!a)return this._setHeaderCellFocus(d),b||e||this._unclipColumnElement(d),!0}return!1};
AdfDhtmlTableBasePeer.prototype._setIndexedFilterCellFocus=function(a){if(0<=a&&this._isFilterable()){var b=this.__getColumnHeader();if(!this._headerless&&b){for(var b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"t").rows[1].cells[0],d=0;d<a&&b;d++)b=this._getNextColumnHeaderFocusElement(b);b&&this._setHeaderCellFocus(b)}}};
AdfDhtmlTableBasePeer.prototype._setIndexedColumnHeaderFocus=function(a,b,d){return 0==d?this._setFirstColumnHeaderFocus(a,b):!this._headerless&&(a=this._getColumnHeaderId(d))&&(a=AdfAgent.AGENT.getElementById(a))?(this.UpdateFocusManager(AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE,null,a),b||this._unclipColumnElement(a),!0):!1};
AdfDhtmlTableBasePeer.prototype._handleTableBodyArrowUpDown=function(a,b,d){var e=this._isRowSelectionEnabled(),f=this._supportsFocusRowNavigation,g=this._currentScrollTop+(a?-this._averageRowHeight:this._averageRowHeight);if(e||f){var h=this.GetLastRowKey();delete this._lastRowKeyInView;var k=a?this._getPreviousRowKeyAndRow(h):this._getNextRowKeyAndRow(h);if(k.isAtTop)g=this._getActiveCellIndex(),this._setIndexedColumnHeaderFocus(!1,!1,-1==g?0:g);else if(k.isAtButtom)g=this._getActiveCellIndex(),
this._setIndexedColumnFooterFocus(!1,!1,-1==g?0:g);else{var l=this._isMultipleRowSelect(),m=k.lastRowKeyInView,n=k.rowKey;null!=n?(g=k.row,e&&(d&&l?null!=this._selIsSelected(n)&&null!=this._selIsSelected(m)?(a=a?this._getNextRowKeyAndRow(n):this._getPreviousRowKeyAndRow(n),this._selUnselectRow(m,a.row)):this._selIsSelected(n)?this._selUnselectRow(n,g):this._selSelectRow(n,g):b&&l&&f||("enabled"==this.getComponent().getSelectionEventDelay()?(a=AdfPage.PAGE,(h=this.FindRowByKey(h))&&h.tr&&this._selUnhighlightRow(h.tr),
this._selHighlightRow(g),this._selectRowTimer&&(a.cancelTimer(this._selectRowTimer),delete this._selectRowTimer),this._selectRowTimer=a.scheduleTimer(this,this._selectRowForTimer,[n,g],300)):(this._selUnselectAll(),this._selSelectRow(n,g)))),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,n,g),this._unclipRow(g),delete this._selectionRequest):null!=m?0<g&&g<this._getScrollHeight()&&(this._lastRowKeyInView=m,this._selectionRequest=b&&l&&f||!e&&f?a?AdfDhtmlTableBasePeer._FOCUS_ROW_ARROW_UP:
AdfDhtmlTableBasePeer._FOCUS_ROW_ARROW_DOWN:a?AdfDhtmlTableBasePeer._SELECT_ARROW_UP:AdfDhtmlTableBasePeer._SELECT_ARROW_DOWN,(d||b)&&l||(h=!1,a||(n=this.GetRowCount(),0<=n&&(a=this.GetDataBody().childNodes,a=a[a.length-1],h=a.startRow+a.numRows==n)),h||this._selUnselectAll()),this._scrollerScrollToPos(null,g)):(k=a?this._getLastVisibleRowKeyAndRow():this.GetFirstVisibleRowKeyAndRow(),n=k.rowKey,null!=n&&(g=k.row,e&&this._selSelectRow(n,g),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,
n,g),this._unclipRow(g)))}}else 0<=g&&g<this._getScrollHeight()&&this._scrollerScrollToPos(null,g)};AdfDhtmlTableBasePeer.prototype._selectRowForTimer=function(a){var b=a[0];a=a[1];this._selUnselectAll();this._selSelectRow(b,a)};
AdfDhtmlTableBasePeer.prototype.HandleTableBodyArrowLeftRight=function(a,b,d){var e=this.__getScrollLeft()+(a?-20:20);d=!0;if(b)this._hasDetailStamp||(e=Math.max(0,e),e<this._getScrollWidth()&&this._scrollerScrollToPos(e,null)),d=!1;else if(a&&(e=this._focusManager.currency)){var f=this.FindRowByKey(e);if(f&&(f=this.GetRowHeaderCellFromRow(f.tr))){var g=this._findNextCell(this._getActiveCellNode(),!0);if(null==g||g==f)this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,e,f),d=!1}}this._hasDetailStamp&&
b&&(b=this.GetFocusedRowKey(),null!=b&&this.getComponent().setDisclosedRowKey(b,!a));d&&this._changeActiveCell(a)};
AdfDhtmlTableBasePeer.prototype._handleHomeEndKey=function(a,b){if(!b.ctrlKey)switch(this._focusManager.objectType){case AdfDhtmlTableBasePeer._FILTER_CELL_FOCUS_TYPE:case AdfDhtmlTableBasePeer._SELECT_ALL_FOCUS_TYPE:case AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE:var d=null,e;if(!b.ctrlKey&&!b.shiftKey){for(e=a==AdfKeyStroke.HOME_KEY?this._getPrevColumnHeaderFocusElement(this._focusManager.domElement):this._getNextColumnHeaderFocusElement(this._focusManager.domElement);e;)d=e,e=a==AdfKeyStroke.HOME_KEY?
this._getPrevColumnHeaderFocusElement(d):this._getNextColumnHeaderFocusElement(d);d&&(this._unclipColumnElement(d),this._setHeaderCellFocus(d))}break;case AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE:case AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE:if((d=this._focusManager.currency)&&(e=this.FindRowByKey(d))&&e.tr.cells.length){var f=a==AdfKeyStroke.HOME_KEY?e.tr.cells[0]:this._findLastCell(e.tr);f&&(null!=f.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)?this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,
d,f):this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,d,e.tr,f))}}};AdfDhtmlTableBasePeer.prototype._hScrollPage=function(a){var b=this.IsEmpty?this.getDomElement():this._hasSingleScroller()&&!this._isPaged?this.GetScroller():this.GetScroller()[AdfDhtmlTableBasePeer._HSCROLLER];if(b&&b.scrollWidth>b.offsetWidth){var d=AdfAgent.AGENT.getScrollLeft(b)-(a?-1:1)*(b.clientWidth-b.clientWidth/10),d=a?Math.max(d,0):Math.min(d,b.scrollWidth);AdfAgent.AGENT.scrollToPos(b,d)}};
AdfDhtmlTableBasePeer.prototype._handlePageUp=function(a,b,d){if(a)this._hScrollPage(!0);else if(this._virtInitialized){a=this.GetDataBody();var e=this._currentScrollTop-a.offsetHeight;d=e>0-a.offsetHeight;var e=0>e?0:e,f=this.getComponent().getSelectedRowKeys(),g=!1,h;for(h in f){g=!0;break}!g||b?d&&this._scrollerScrollToPos(null,e):(h=this.GetFirstVisibleRowKeyAndRow(),null!=(b=h.rowKey)&&(h=h.row,f=null!=f[b]&&null==f[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY],this._selUnselectAll(),d&&f?(this._selectionRequest=
AdfDhtmlTableBasePeer._SELECT_PAGE_UP,e=h.offsetTop+h.parentNode.parentNode.startPos-a.offsetHeight,this._scrollerScrollToPos(null,e)):(this._selSelectRow(b,h),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,b,h),this._unclipRow(h))))}};
AdfDhtmlTableBasePeer.prototype._handlePageDown=function(a,b,d){if(a)this._hScrollPage(!1);else if(this._virtInitialized){d=this.GetDataBody();a=this.getComponent().getSelectedRowKeys();var e=!1,f;for(f in a){e=!0;break}!e||b?(a=this._currentScrollTop+d.offsetHeight,a<this._getScrollHeight()&&this._scrollerScrollToPos(null,a)):(f=this._getLastVisibleRowKeyAndRow(),null!=(b=f.rowKey)&&(f=f.row,a=null!=a[b]&&null==a[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY],this._selUnselectAll(),a?(this._selectionRequest=
AdfDhtmlTableBasePeer._SELECT_PAGE_DOWN,this._scrollerScrollToPos(null,this._currentScrollTop+(f.offsetTop+f.offsetHeight-(this._currentScrollTop-f.parentNode.parentNode.startPos)))):(this._selSelectRow(b,f),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,b,f),this._unclipRow(f))))}};
AdfDhtmlTableBasePeer.prototype._getLastVisibleRowKeyAndRow=function(){for(var a=AdfAgent.AGENT,b=this.GetDataBody(),d=b.childNodes,e={},f=d.length-1;0<=f&&!e.rowKey;--f)for(var g=d[f].startPos,h=d[f].rows,k=h.length-1;0<=k;--k){var l=h[k];if(l.offsetTop-(this._currentScrollTop-g)+AdfDhtmlTableBasePeer._MAXIMUM_ROW_REVEAL<b.offsetHeight){g=a.getAttribute(l,AdfDhtmlTableBasePeer._ROW_KEY);e.rowKey=g;e.row=l;break}}return e};
AdfDhtmlTableBasePeer.prototype.GetFirstVisibleRowKeyAndRow=function(a){var b=this._cachedFirstVisibleRowKeyAndRow;if(b)return b;var d=AdfAgent.AGENT,e=this.GetDataBody().childNodes,f=e.length,b={};a=void 0==a?AdfDhtmlTableBasePeer._MAXIMUM_ROW_REVEAL:a;for(var g=0;g<f&&!b.rowKey;++g){var h=e[g],k=h.startPos,l=h.rows,m=0;null!=l&&(m=l.length);for(var n=0;n<m;++n)if(h=l[n],h.offsetTop+h.offsetHeight+k-a>this._currentScrollTop){k=d.getAttribute(h,AdfDhtmlTableBasePeer._ROW_KEY);b.rowKey=k;b.row=h;break}}return this._cachedFirstVisibleRowKeyAndRow=
b};
AdfDhtmlTableBasePeer.prototype.scrollToRowIndex=function(a,b){var d=a*this._averageRowHeight,e=this.getComponent(),f=this.GetFirstVisibleRowKeyAndRow(),e=f.rowKey?e.getRowIndex(f.rowKey):null,g;this._currentScrollTop!=d&&(g=this.scrollToPos(-1,d,!0,!1));e==a||g==AdfDhtmlTableBasePeer.VIEWPORT_SATISFIED?this._callCallbackWithStatus(b,this.SCROLL_SUCCEEDED):(d=this._postEvalCallback,this._callCallbackWithStatus(d,this.SCROLL_CANCELLED),this._postEvalCallback=b,d||AdfPage.PAGE.addEventListener(AdfDomReplacedEvent.EVENT_TYPE,this._domReplacedListener,
this))};AdfDhtmlTableBasePeer.prototype._callCallbackWithStatus=function(a,b){if(a){AdfAssert.assertFunction(a);var d={};d.status=b;a(d)}};AdfDhtmlTableBasePeer.prototype._domReplacedListener=function(a){var b=this.getComponent();AdfAssert.assertPrototype(b,AdfUIComponent);b=b.getClientId();a.containsClientId(b)&&(AdfPage.PAGE.removeEventListener(AdfDomReplacedEvent.EVENT_TYPE,this._domReplacedListener,this),a=this._postEvalCallback,this._postEvalCallback=null,this._callCallbackWithStatus(a,this.SCROLL_SUCCEEDED))};
AdfDhtmlTableBasePeer.prototype._getNextRowKeyAndRow=function(a){for(var b=AdfAgent.AGENT,d=this.GetDataBody().childNodes,e=d.length,f={},g=0;g<e&&!f.rowKey;++g)for(var h=d[g].rows,k=h.length,l=0;l<k;++l){var m=h[l],n=b.getAttribute(m,AdfDhtmlTableBasePeer._ROW_KEY);if(null==a){f.rowKey=n;f.row=m;break}else if(n==a){f.lastRowKeyInView=n;if(l+1<k){m=h[l+1];if(this._hasDetailStamp&&AdfAgent.AGENT.getAttribute(m,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1))if(l+2<k)m=h[l+2];else if(g+1<e&&0<d[g+1].rows.length)m=
d[g+1].rows[0];else return f;n=b.getAttribute(m,AdfDhtmlTableBasePeer._ROW_KEY);f.rowKey=n;f.row=m}else if(g+1<e)h=d[g+1].rows,0<h.length&&(m=h[0],n=b.getAttribute(m,AdfDhtmlTableBasePeer._ROW_KEY),f.rowKey=n,f.row=m);else if(h=d[e-1],h.startRow+h.numRows==this.GetRowCount()||this._isPaged)f.isAtButtom=!0;break}}return f};
AdfDhtmlTableBasePeer.prototype._getPreviousRowKeyAndRow=function(a){for(var b=AdfAgent.AGENT,d=this.GetDataBody().childNodes,e={},f=d.length-1;0<=f&&!e.rowKey;--f)for(var g=d[f],h=d[f].rows,k=h.length-1;0<=k;--k){var l=h[k],m=b.getAttribute(l,AdfDhtmlTableBasePeer._ROW_KEY);if(null==a){e.rowKey=m;e.row=l;break}else if(m==a){e.lastRowKeyInView=m;if(0<=k-1){l=h[k-1];if(this._hasDetailStamp&&AdfAgent.AGENT.getAttribute(l,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1))if(0<=k-2)l=h[k-2];else if(0<=f-1&&
0<d[f-1].rows.length)l=d[f-1].rows[d[f-1].rows.length-1];else return e;m=b.getAttribute(l,AdfDhtmlTableBasePeer._ROW_KEY);e.rowKey=m;e.row=l}else 0<=f-1?(h=d[f-1].rows,0<h.length&&(l=h[h.length-1],m=b.getAttribute(l,AdfDhtmlTableBasePeer._ROW_KEY),e.rowKey=m,e.row=l)):0==b.getIntAttribute(g,"_startRow",-1)&&(e.isAtTop=!0);break}}return e};
AdfDhtmlTableBasePeer.prototype._handleSpaceKey=function(a,b){var d=AdfAgent.AGENT,e=this._focusManager;switch(e.objectType){case AdfDhtmlTableBasePeer._SELECT_ALL_FOCUS_TYPE:this._grabFocus();this.getComponent().getSelectedRowKeys()[AdfDhtmlTableBasePeer.SELECTALL_KEY_PROPERTY]||this._selSelectAll();break;case AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE:e=this.GetRowKeyAndRow(e.domElement,this.getDomElement());null!=e&&(this._grabFocus(),this._doRowSelection(d.getEventTarget(b),d.isSelectionToggle(b),
b.shiftKey,e[0],e[1]));break;case AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE:if(this._isColumnSelectionEnabled()){var d=[],f=[];this._anchorColumnHeader=e=e.domElement;this._resolveColumns(d,f,e);this._doColumnSelections(b,d,f)}break;case AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE:this._supportsFocusRowNavigation&&(e=this._focusManager.currency,null!=e&&(this._selIsSelected(e)?b.ctrlKey&&this._selUnselectRow(e,this._focusManager.domElement):this._selSelectRow(e,this._focusManager.domElement)))}};
AdfDhtmlTableBasePeer.prototype._handleEnterKey=function(a,b){var d=AdfAgent.AGENT,e=this._focusManager,f=!1;if(this._isTargetCellFilter(a)){this._editableTableReadOnlyMode&&this._setReadOnlyMode(!1,a,!0);d.getPlatform()==AdfAgent.GECKO_PLATFORM&&0<this._currentScrollLeft&&AdfFocusUtils.focusElement(this.getDomElement());if(f=AdfPage.PAGE.findComponent(d.getAttribute(a,"name")))e=f.getPeer(),e.bind(f),e instanceof AdfDhtmlInputBasePeer&&e.RunValidation(f,a,!1);this._handleFilterCellAction();f=!0}else if(this._isTargetCellEditable(a))d=
this.GetRowKeyAndRow(a,this.getDomElement()),null!=d&&(e=d[0],null!=e&&(d=this._getCellAndIndexForNode(a,d[1]),this._ctePatternStart!=d.cellIndex&&delete this._ctePatternStart,d=d.cellIndex,-1<d&&(f=this._isClickToEdit()?this._clickToEditActivateRow(e,!b.shiftKey,d):this._setFocusOnEditableRowCell(e,!b.shiftKey,d))));else if(this._focusManager.objectType==AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE){if((e=e.domElement)&&null!=d.getElementById(AdfRichUIPeer.CreateSubId(e.id,AdfDhtmlTableBasePeer.__SORT_INDICATOR))){var d=
AdfPage.PAGE.findComponent(e.id).getSortProperty(),g=AdfDhtmlTableBasePeer.__getSortOrderForColumn(e.id),g=null==g?!0:!g;this.getComponent().setProperty("currentlySelectedHeaderId",e.id);AdfTableUtils.queueSortEvent(this.getComponent(),d,g)}}else if(this._isClickToEdit()&&null!=this.GetFocusedRowKey())this._editableTableReadOnlyMode||this.GetFocusedRowKey()!=this._getActiveRowKey()||null==this._getActiveRowKey()?(this._setActiveRowKey(this.GetFocusedRowKey()),this._setReadOnlyMode(!1,a,!1),d=this._getActiveCellIndex(),
-1==d&&(d=this._lastCTEIndex),void 0!=d&&(this._clickEditRequest={cellIndex:d})):f=this._clickToEditActivateRow(this.GetFocusedRowKey(),!b.shiftKey,this._lastCTEIndex);else if(!this._isClickToEdit()&&this._editableTableReadOnlyMode)this._setReadOnlyMode(!1,a,!0);else return!0;return!f};
AdfDhtmlTableBasePeer.prototype._setFocusOnEditableRowCell=function(a,b,d){var e=b?this._getNextRowKeyAndRow(a):this._getPreviousRowKeyAndRow(a);a=e.rowKey;if(null!=a){b=AdfAgent.AGENT;e=e.row;d=this.FindCellByIndex(e,d);var f=!0;null==this._setFocusOnEditableElementInNode(b,d)&&null==this._setFocusOnEditableElementInNode(b,e)&&(f=!1);f&&this._isRowSelectionEnabled()&&!this._selIsSelected(a)&&(this._selUnselectAll(),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,a,e),this._selSelectRow(a,
e))}return null!=a};AdfDhtmlTableBasePeer.prototype._indexOfDomElement=function(a,b){for(var d=a.length,e=0;e<d;e++)if(a[e]==b)return e;return-1};
AdfDhtmlTableBasePeer.prototype._getFirstInputElementInNode=function(a,b,d){var e=a.getDomDocument();a=null;if(e.evaluate){b=e.evaluate('.//input[not(@type\x3d"hidden")]|.//select|.//textarea|.//button|.//a|.//*[@tabindex\x3e\x3d0]',b,null,XPathResult.ANY_TYPE,null);for(var f=b.iterateNext();f;){e=this._isElementVisible(f);if((d||e&&!f.disabled&&-1!=f.tabIndex)&&("A"!=f.nodeName||f.href)){a=f;break}f=b.iterateNext()}}else{b=b.getElementsByTagName("*");for(var g=b.length,h=AdfDhtmlTableBasePeer._INPUT_REGEXP,
k=0;k<g;k++){var f=b[k],l=f.getAttribute("tabIndex",2);if(null!=l&&0<=l&&32768!=l&&65535!=l||f.tagName.match(h))if(e=this._isElementVisible(f),(d||e&&!f.disabled&&-1!=l)&&("A"!=f.nodeName||f.href)){a=f;break}}}return a};AdfDhtmlTableBasePeer.prototype._isElementVisible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects&&a.getClientRects().length)};
AdfDhtmlTableBasePeer.prototype._setFocusOnEditableElementInNode=function(a,b){var d=this._getFirstInputElementInNode(a,b);if(d){var e="INPUT"==d.nodeName;if(a.getPlatform()!=AdfAgent.GECKO_PLATFORM||!e||"file"!=d.type){var f=AdfPage.PAGE.getActiveDomElement();f&&f.blur&&f.blur();var f=!1,g=AdfPage.PAGE.getZOrderManager();g&&g.containsElement(this.getDomElement())&&(f=!0);a.getPlatform()==AdfAgent.IE_PLATFORM&&f&&!this._isClickToEdit()?AdfFocusUtils.focusElementDelayed(d,1):AdfFocusUtils.focusElement(d);
e&&d.select();return d}}return null};
AdfDhtmlTableBasePeer.prototype._setInputElementCursorAtEndInNode=function(a,b){var d=this._getFirstInputElementInNode(a,b);if(d&&("INPUT"==d.nodeName&&"text"==d.type||"TEXTAREA"==d.nodeName)){var e=d.value.length;null!=d.selectionStart?(d.setSelectionRange(e,e),d.blur(),d.focus(),e=d.ownerDocument.createEvent("KeyboardEvent"),void 0!=e.initKeyEvent?e.initKeyEvent("keypress",!0,!0,null,!1,!1,!1,!1,27,0):e.initUIEvent("keypress",!0,!0,window,1),d.dispatchEvent(e)):(e=d.createTextRange(),e.collapse(!1),
e.select());return d}return null};AdfDhtmlTableBasePeer.prototype._unclipRow=function(a){AdfAssert.assert(null!=a,"Unable to unclipRow without a valid row being passed in!");var b=this.GetDataBody(),d=a.offsetTop+a.parentNode.parentNode.startPos;d<this._currentScrollTop?this._scrollerScrollToPos(null,d):(a=a.offsetTop+a.offsetHeight-(this._currentScrollTop-a.parentNode.parentNode.startPos),a>b.offsetHeight&&this._scrollerScrollToPos(null,this._currentScrollTop+(a-b.offsetHeight)))};
AdfDhtmlTableBasePeer.prototype.UpdateFocusManager=function(a,b,d,e){var f=this._focusManager;null!=f.domElement&&this._updateFocusCellStyle(!1);f.objectType=a;f.currency=b;f.domElement=d;this._updateFocusCellStyle(!0);this._disableRowMouseDownCellFocus||(e?this._setActiveDescendant(e,!0):f.domElement&&("TR"==f.domElement.nodeName?this._moveActiveCellToRow(f.domElement):this._setActiveDescendant(f.domElement,!0)))};
AdfDhtmlTableBasePeer.prototype._getLabelText=function(a){for(var b="",d=(a=a.childNodes)?a.length:0,e=0;e<d;e++){var f=a[e];1==f.nodeType&&(f="LABEL"==f.nodeName?f.textContent:this._getLabelText(f))&&(b+=(b?" ":"")+f)}return b};
AdfDhtmlTableBasePeer.prototype._getSortColumnHeaderLabel=function(a){var b=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(a.id,AdfDhtmlTableBasePeer.__SORT_INDICATOR));if(b&&b.rows[0]){var d=b.rows[0].cells;if(d&&0<d.length){var e;b.getAttribute(AdfDhtmlTableBasePeer._SORTED_TYPE)==AdfDhtmlTableBasePeer._SORTED_ASCENDING&&(e=AdfDomUtils.getFirstDescendentElement(d[1],"A"));e||(e=AdfDomUtils.getFirstDescendentElement(d[0],"A"));if(e)return a.textContent+" "+e.title}}return null};
AdfDhtmlTableBasePeer.prototype._setActiveDescendant=function(a,b){var d=this.getDomElement();if(d){var e=this._getActiveCellNode();if(e){if("columnheader"==e.getAttribute("role")&&null==e.getAttribute(AdfDhtmlTableBasePeer._SELECT_ALL))e.removeAttribute("aria-label");else{var f=e.getAttribute("aria-labelledby");if(f)for(var f=f.split(" "),g,h=0;h<f.length;h++)0<f[h].indexOf(":_ariaRHId")&&(g=this.getDomDocument().getElementById(f[h]))&&g.removeAttribute("id");e.removeAttribute("aria-labelledby")}e.id&&
0<e.id.indexOf(":_ariaActiveId")&&e.removeAttribute("id")}a.id||(this._ariaIdSuffix=1==this._ariaIdSuffix?0:1,a.id=this.getDomElement().id+":_ariaActiveId"+this._ariaIdSuffix);g=a.getAttribute("role");if(this._isFilterCell(a))a.getAttribute("aria-label")||a.setAttribute("aria-label",this._getLabelText(a));else if("columnheader"==g)(e=this._getSortColumnHeaderLabel(a))&&a.setAttribute("aria-label",e);else if("presentation"!=g){e="";"rowheader"!=g&&(g=this.GetRowKeyAndRow(a,this.getDomElement()),null!=
g&&(e=this._getRowHeaderIds(g[1])));g=this._getCellIndex(a);if(g=this._getLayeredColumnHeaderIds(g))e&&(e+=" "),e+=g;e&&(e=e+" "+a.id,a.setAttribute("aria-labelledby",e))}d.setAttribute("aria-activedescendant",a.id);if(this._editableTableReadOnlyMode||null==this._getFirstInputElementInNode(AdfAgent.AGENT,a))d=!1,(e=AdfPage.PAGE.getZOrderManager())&&e.containsElement(this.getDomElement())&&(d=!0),!this.AllowCellNavigation()||AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&!this._isClickToEdit()&&
d?(g=this.GetRowKeyAndRow(a,this.getDomElement()))&&this._setFocusOnNode(g[1],!0):this._setFocusOnNode(a,!0)}};AdfDhtmlTableBasePeer.prototype._findNextCell=function(a,b){var d=null;if(a){var e=this.GetRowKeyAndRow(a,this.getDomElement());if(null!=e&&(e=e[1],null!=e)){var f=this._getCellAndIndexForNode(a,e);f&&-1!=f.cellIndex&&(b?0<f.cellIndex&&(d=this.FindCellByIndex(e,f.cellIndex-1)):d=this.FindCellByIndex(e,f.cellIndex+1))}}return d};
AdfDhtmlTableBasePeer.prototype._findLastCell=function(a){var b=null;if(null!=a)for(var d=0,e;e=this.FindCellByIndex(a,d);)b=e,++d;return b};
AdfDhtmlTableBasePeer.prototype._getCellIndex=function(a){var b=-1,d=this.getDomElement();if(d&&a){var e=a.getAttribute("role");if(this._isFilterCell(a))b=AdfAgent.AGENT.getIntAttribute(a,"_d_index",-1);else if("columnheader"==e){if(d=AdfAgent.AGENT.getAttribute(d,"_leafColClientIds"),null!=d&&(d=d.replace(/'/g,'"')),d=JSON.parse(d),null!=d)for(var e=d.length,f=0;f<e;f++)if(d[f]==a.id){b=f;break}}else d=this.GetRowKeyAndRow(a,this.getDomElement()),null!=d&&null!=d[0]&&(d=this._getCellAndIndexForNode(a,
d[1]))&&(b=d.cellIndex),this._footerless||-1!=b||(b=AdfAgent.AGENT.getIntAttribute(a,"_d_index",-1))}return b};AdfDhtmlTableBasePeer.prototype._getActiveCellNode=function(){var a,b=this.getDomElement();if(b)for((b=b.getAttribute("aria-activedescendant"))&&0<b.length&&(a=this.getDomDocument().getElementById(b));a&&"TD"!=a.nodeName&&"TH"!=a.nodeName;)a=a.parentNode;return a};AdfDhtmlTableBasePeer.prototype._getActiveCellIndex=function(){return this._getCellIndex(this._getActiveCellNode())};
AdfDhtmlTableBasePeer.prototype._changeActiveCell=function(a){var b;(b=this._findNextCell(this._getActiveCellNode(),a))?this._setActiveDescendant(b,!1):null!=this._associatedPeer&&(a?null!=this.getComponent().getProperty("_afrMasterId")&&(a=this._getActiveCellNode(),a=a.parentNode.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),this._associatedPeer.handleNavFromAssociatedPeer(a)):null!=this.getComponent().getProperty("_afrSlaveId")&&(a=this._getActiveCellNode(),a=a.parentNode.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),
this._associatedPeer.handleNavToAssociatedPeer(a)));return b};AdfDhtmlTableBasePeer.prototype._setHeaderCellFocus=function(a){var b;a.getAttribute(AdfDhtmlTableBasePeer._FILTER_COLUMN)?b=AdfDhtmlTableBasePeer._FILTER_CELL_FOCUS_TYPE:a.getAttribute(AdfDhtmlTableBasePeer._SELECT_ALL)?b=AdfDhtmlTableBasePeer._SELECT_ALL_FOCUS_TYPE:"columnheader"==a.getAttribute("role")&&(b=AdfDhtmlTableBasePeer._COLUMN_HEADER_FOCUS_TYPE);b&&this.UpdateFocusManager(b,null,a);return b};
AdfDhtmlTableBasePeer.prototype._restoreActiveCellFromDom=function(){var a=this.getDomElement(),b=document.activeElement;b&&AdfDomUtils.isAncestor(a,b)&&("TH"==b.nodeName?this._setHeaderCellFocus(b):"TD"==b.nodeName?(a=this.GetRowKeyAndRow(b,a))&&(b.getAttribute(AdfDhtmlTableBasePeer._ROW_HEADER)?this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,a[0],b):this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,a[0],a[1],b)):(a=this._getTargetCell(b))&&this._isFilterCell(a)&&
this._setReadOnlyMode(!1,b,!1))};AdfDhtmlTableBasePeer.prototype.handleNavFromAssociatedPeer=function(a){var b=this.FindRowByKey(a);if(b&&b.tr){var d=this._findLastCell(b.tr);this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,a,b.tr,d)}};AdfDhtmlTableBasePeer.prototype.handleNavToAssociatedPeer=function(a){var b=this.FindRowByKey(a);if(b&&b.tr){var d=this.FindCellByIndex(b.tr,0);this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,a,b.tr,d)}};
AdfDhtmlTableBasePeer.prototype._getColumnHeaderId=function(a){var b;if(!this._headerless){var d=this.getDomElement();d&&(d=AdfAgent.AGENT.getAttribute(d,"_leafColClientIds"),null!=d&&(d=d.replace(/'/g,'"')),d=JSON.parse(d),null!=d&&d.length>a&&(b=d[a]))}return b};AdfDhtmlTableBasePeer.prototype._getLayeredColumnHeaderIds=function(a){var b=this._getColumnHeaderId(a);a=b;if(null!=b)for(b=AdfAgent.AGENT.getElementById(b);b;)(b=this._resolveImmediateParentColumn(b))&&b.id&&(a=b.id+" "+a);return a};
AdfDhtmlTableBasePeer.prototype._getRowHeaderIds=function(a){var b="",d=this.getDomElement().id;if(a)for(var e,f=0;e=this.FindCellByIndex(a,f++);)if("rowheader"==e.getAttribute("role")){var g;(g=this._getFirstInputElementInNode(AdfAgent.AGENT,e,!0))&&g.id?e=g.id:(e.id||(e.id=d+":_ariaRHId"+f),e=e.id);b=b+" "+e}return b};AdfDhtmlTableBasePeer.prototype._moveActiveCellToRow=function(a){var b=this._getActiveCellIndex();-1==b&&(b=0);(a=this.FindCellByIndex(a,b))&&this._setActiveDescendant(a,!0)};
AdfDhtmlTableBasePeer.prototype._getTargetCell=function(a){for(var b=this.getDomElement();a&&"TD"!=a.nodeName&&"TH"!=a.nodeName;){if(a==b)return null;a=a.parentNode}return a};
AdfDhtmlTableBasePeer.prototype._setReadOnlyMode=function(a,b,d){this._disableTabStop(a);this._editableTableReadOnlyMode=a;if(d)if(a){var e;a=this.GetRowKeyAndRow(b,this.getDomElement());null!=a&&null!=a[0]&&(e=this._getCellAndIndexForNode(b,a[1]),this._isClickToEdit()&&(this._lastCTEIndex=e.cellIndex),e.cell&&this._setActiveDescendant(e.cell,!1));(b=this._getTargetCell(b))&&this._isFilterCell(b)?this._setHeaderCellFocus(b):this._isClickToEdit()?(this._setActiveRowKey(null),this._grabFocus()):e&&
e.cell||this._grabFocus()}else(e=this._getActiveCellNode())&&this._setFocusOnEditableElementInNode(AdfAgent.AGENT,e)};AdfDhtmlTableBasePeer.prototype._updateFocusCellStyle=function(a){var b=this._focusManager;a&&b.domElement?AdfDomUtils.addCSSClassName(b.domElement,AdfDhtmlTableBasePeer._FOCUSED_CLASS):!a&&b.domElement&&AdfDomUtils.removeCSSClassName(b.domElement,AdfDhtmlTableBasePeer._FOCUSED_CLASS)};AdfDhtmlTableBasePeer.prototype._isFilterable=function(){return null!=this.getDomElement().getAttribute(AdfDhtmlTableBasePeer._FILTERABLE)};
AdfDhtmlTableBasePeer.prototype._isTargetCellFilter=function(a){for(var b=this.getDomElement(),d=AdfAgent.AGENT,e=d.getAttribute(a,AdfDhtmlTableBasePeer._FILTER_COLUMN);null==e;){if(null==a||a==b)return!1;a=a.parentNode;if(null==a||1!=a.nodeType)break;e=d.getAttribute(a,AdfDhtmlTableBasePeer._FILTER_COLUMN)}return null!=e};AdfDhtmlTableBasePeer.prototype._handleFilterCellAction=function(){var a=this.getComponent();a.queueEvent(new AdfQueryEvent(a));a.setSelectedRowKeys(null)};
AdfDhtmlTableBasePeer.prototype.getRowKeyForEvent=function(a){a=a.getNativeEventTarget();if(null==this._getTargetRowHeader(a)){var b=this.getDomElement();a=this.GetRowKeyAndRow(a,b);if(null!=a)return a[0]}return null};AdfDhtmlTableBasePeer.prototype.applyDragReadyStateForRowKeys=function(a,b,d){AdfAssert.assertArray(d);a=this._getDomNodesForDrag(d);b=0;for(d=a.length;b<d;++b)AdfDomUtils.addCSSClassName(a[b],AdfRichUIPeer.DRAG_READY_STYLECLASS);return a};
AdfDhtmlTableBasePeer.prototype.ClearDragReadyState=function(a){AdfAssert.assertArray(a);for(var b=0,d=a.length;b<d;++b)AdfDomUtils.removeCSSClassName(a[b],AdfRichUIPeer.DRAG_READY_STYLECLASS)};AdfDhtmlTableBasePeer.prototype.applyDragSourceStateForRowKeys=function(a,b,d){AdfAssert.assertArray(d);a=this._getDomNodesForDrag(d);b=0;for(d=a.length;b<d;++b)AdfDomUtils.addCSSClassName(a[b],AdfRichUIPeer.DRAG_SOURCE_STYLECLASS);return a};
AdfDhtmlTableBasePeer.prototype.ClearDragSourceState=function(a){AdfAssert.assertArray(a);for(var b=0,d=a.length;b<d;++b)AdfDomUtils.removeCSSClassName(a[b],AdfRichUIPeer.DRAG_SOURCE_STYLECLASS)};
AdfDhtmlTableBasePeer.prototype.getDragOffsetForRowKeys=function(a,b){var d=a.getNativeEventTarget(),e=this.getDomElement(),f=this.GetRowKeyAndRow(d,e),e=d=0,g=AdfAgent.AGENT;if(null!=f)for(var h=f[0],f=f[1],k=0;k<b.length;k++)if(b[k]==h){h=g.getElementPosition(f);g=g.getMousePosition(a.getNativeEvent());d=g.x-h.x;e+=g.y-h.y;this._hasFrozenColumn()&&(d-=AdfDhtmlTableBasePeer.__getChildBySubId(this.__getColumnHeader(),"t").offsetWidth);break}else{var l=this.FindRowByKey(b[k]);AdfAssert.assert(null!=
l);e+=l.tr.offsetHeight}return{x:d,y:e}};AdfDhtmlTableBasePeer.prototype.getDragNodeForRowKeys=function(a){AdfAssert.assertArray(a);var b=this.getDomDocument().createElement("table");a=this._getDomNodesForDrag(a);for(var d=0,e=a.length;d<e;++d){var f=this._cloneCellForDrag(a[d]);b.insertRow(-1).appendChild(f)}return b};
AdfDhtmlTableBasePeer.prototype._getDomNodesForDrag=function(a){for(var b=[],d=this._lastFrozen,e=this.GetDataBody(),f=0;f<a.length;++f){var g=this.FindRowByKey(a[f]);if(g){var g=g.tr,h=g.parentNode.parentNode.startPos;g.offsetTop+g.offsetHeight+h-AdfDhtmlTableBasePeer._MAXIMUM_ROW_REVEAL>this._currentScrollTop&&g.offsetTop-(this._currentScrollTop-h)+AdfDhtmlTableBasePeer._MAXIMUM_ROW_REVEAL<e.offsetHeight&&(h=g.cells[0],this._freezeColumnsToStart()?h=this._getInnerTableCell(g,d+1):this._freezeColumnsToEnd()&&
(h=this._getInnerTableCell(g,0)),null==h&&(h=g.cells[0]),b.push(h))}}return b};AdfDhtmlTableBasePeer.prototype._cloneCellForDrag=function(a){var b=a.cloneNode(!0),d=AdfAgent.AGENT;d.copyStyle(a,b);a=b.style;a.width="";a.borderRight=a.borderBottom="0px";d.setOpacity(b,50);return b};
AdfDhtmlTableBasePeer.prototype.getRowKeyAndOrientationFromHints=function(a,b,d){AdfAssert.assertNumber(a);AdfAssert.assertNumber(b);AdfAssert.assert(null!=d);var e=d[AdfStampedDropTarget.HINT_LAST_ROWKEY],f=d[AdfStampedDropTarget.HINT_LAST_ROWKEY_BOUNDS],g=d[AdfStampedDropTarget.HINT_LAST_DROP_ORIENTATION];if(e&&f&&(AdfAssert.assertString(e),AdfAssert.assertObject(f),a>=f.left&&b>=f.top&&a<=f.right&&b<=f.bottom)){d[AdfStampedDropTarget.ROW_KEY]=e;d[AdfStampedDropTarget.DROP_ORIENTATION]=g;return}this._getRowKeyAndOrientationForPosition(a,
b,d)};
AdfDhtmlTableBasePeer.prototype._getRowKeyAndOrientationForPosition=function(a,b,d){AdfAssert.assertNumber(a);AdfAssert.assertNumber(b);var e=this.GetDataBody(),f=AdfDomUtils.getElementAtPoint(e,a,b,null,{colgroup:!0});if(f&&(f=this.GetRowKeyAndRow(f,this.getDomElement()),null!=f)){d[AdfStampedDropTarget.ROW_KEY]=f[0];d[AdfStampedDropTarget.DROP_ORIENTATION]=AdfDropEvent.DROP_ORIENTATION_ON;return}this.IsEmpty?(d[AdfStampedDropTarget.ROW_KEY]=null,d[AdfStampedDropTarget.DROP_ORIENTATION]=AdfDropEvent.DROP_ORIENTATION_AFTER):AdfAgent.AGENT.pointInElementBounds(e,
a,b)?(d[AdfStampedDropTarget.ROW_KEY]=this._getLastRowKey(),d[AdfStampedDropTarget.DROP_ORIENTATION]=AdfDropEvent.DROP_ORIENTATION_AFTER):(d[AdfStampedDropTarget.ROW_KEY]=null,d[AdfStampedDropTarget.DROP_ORIENTATION]=AdfDropEvent.DROP_ORIENTATION_ON)};
AdfDhtmlTableBasePeer.prototype.showDragFeedback=function(a,b,d,e,f,g,h){AdfAssert.assertPrototype(a,AdfDnDContext);AdfAssert.assertStringOrNull(b);AdfAssert.assertNumber(d);AdfAssert.assertStringOrNull(e);d==AdfDnDContext.ACTION_NONE&&(AdfDomUtils.removeCSSClassName(this.GetDataBody(),AdfDhtmlTableBasePeer._DROP_TARGET_CLASS),b=null);e!=b&&(e&&(a=this.FindRowByKey(e))&&AdfDomUtils.removeCSSClassName(a.tr,AdfDhtmlTableBasePeer._DROP_TARGET_CLASS),b&&(a=this.FindRowByKey(b)))&&(AdfDomUtils.addCSSClassName(a.tr,
AdfDhtmlTableBasePeer._DROP_TARGET_CLASS),AdfDomUtils.removeCSSClassName(this.GetDataBody(),AdfDhtmlTableBasePeer._DROP_TARGET_CLASS));null==b&&d!=AdfDnDContext.ACTION_NONE&&AdfDomUtils.addCSSClassName(this.GetDataBody(),AdfDhtmlTableBasePeer._DROP_TARGET_CLASS)};AdfDhtmlTableBasePeer.prototype.getRowKeyBounds=function(a){return a?(a=this.FindRowByKey(a))?AdfAgent.AGENT.getElementPageBounds(a.tr):null:null};
AdfDhtmlTableBasePeer.prototype.ShiftIndex=function(a,b,d){for(;a;)a.startRow+=b,a=d?a.nextSibling:a.previousSibling};AdfDhtmlTableBasePeer.prototype.IsReceivingActiveEvents=function(){return-1!=this._activeDataCount};AdfDhtmlTableBasePeer.prototype.RemoveAllBlocks=function(a){for(var b=a.childNodes,d=b.length-1;0<=d;d--)this._unregisterNode(b[d]),a.removeChild(b[d])};
AdfDhtmlTableBasePeer.prototype._getFirstRowKey=function(){var a=this.GetDataBody().childNodes;return 0<a.length?this._getBlockFirstRowKey(a[0]):null};AdfDhtmlTableBasePeer.prototype._getLastRowKey=function(){var a=this.GetDataBody().childNodes,b=a.length;return 0<b?this._getBlockLastRowKey(a[b-1]):null};
AdfDhtmlTableBasePeer.prototype._getBlockFirstRowKey=function(a){AdfAssert.assert(null!=a.rows&&0<a.rows.length,"Unable to get row key by index when the block contains no rows!");return AdfAgent.AGENT.getAttribute(a.rows[0],AdfDhtmlTableBasePeer._ROW_KEY)};
AdfDhtmlTableBasePeer.prototype._getBlockLastRowKey=function(a){AdfAssert.assert(null!=a.rows&&0<a.rows.length,"Unable to get row key by index when the block contains no rows!");var b=AdfAgent.AGENT;a=a.rows[a.rows.length-1];var d=b.getAttribute(a,AdfDhtmlTableBasePeer._ROW_KEY);null==d&&a.previousSibling&&(d=b.getAttribute(a.previousSibling,AdfDhtmlTableBasePeer._ROW_KEY));return d};AdfDhtmlTableBasePeer.prototype._isImmediateContentDelivery=function(a){return"immediate"==a.getContentDelivery()};
AdfDhtmlTableBasePeer.prototype._isInlineDataAvailable=function(a){return a.getProperty("_afrDataInline")};
AdfDhtmlTableBasePeer.prototype._sizeRegionsForFrozenColumns=function(a,b){if(this._hasFrozenColumn()&&!this._areAllColumnsFrozen(this._colCount)){for(var d=a.firstChild;d;)this._sizeBlockForFrozenColumns(d,b),d=d.nextSibling;var e=this.__getColumnHeader(),f=this._unfrozenWidth;if(null!=e)if(d=AdfDhtmlTableBasePeer.__getChildBySubId(e,"d2"),this._freezeColumnsToEnd()){if(e=AdfDhtmlTableBasePeer.__getChildBySubId(e,"t"))f=this._unfrozenWidth,b<this._totalWidth&&(f=Math.max(b-this._frozenWidth,0)),
d.style.width=f+"px",AdfDhtmlTableBasePeer.__getChildBySubId(d,"t2").style.width=f+"px",AdfDhtmlTableBasePeer._isRTL()?e.style.right=d.style.width:e.style.left=d.style.width}else d.style.width=Math.max(b-this._frozenWidth,0)+"px";f=this._getColumnFooter();if(null!=f)if(d=AdfDhtmlTableBasePeer.__getChildBySubId(f,"fd2"),this._freezeColumnsToEnd()){if(e=AdfDhtmlTableBasePeer.__getChildBySubId(f,"ft"))f=this._unfrozenWidth,b<this._totalWidth&&(f=b-this._frozenWidth),d.style.width=f+"px",AdfDhtmlTableBasePeer._isRTL()?
e.style.right=d.style.width:e.style.left=d.style.width}else d.style.width=Math.max(b-this._frozenWidth,0)+"px"}};AdfDhtmlTableBasePeer.prototype._getUnfrozenColumnsWidth=function(){var a=0,b=this.__getColumnHeader();if(b=AdfDhtmlTableBasePeer.__getChildBySubId(b,"d2"))a=b.offsetWidth;return a};
AdfDhtmlTableBasePeer.prototype._sizeBlockForFrozenColumns=function(a,b){if(this._hasFrozenColumn()){AdfAssert.assert(null!=a.rows&&null!=a.rows[0],"Unable to _sizeBlockForFrozenColumns when block contains no rows!");var d=a.rows[0].cells;if(!this._areAllColumnsFrozen(d.length)){var e;if(this._freezeColumnsToEnd()){e=Math.max(b-this._frozenWidth,0);var f=this._frozenWidth;0<this._totalWidth&&b>=this._totalWidth&&(e=this._unfrozenWidth);0<this._frozenWidth&&b<this._frozenWidth&&(f=b);d=d[0];d.style.width=
e+"px";a.style.width=e+f+"px";if(this._processColGroup()&&(e=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"COLGROUP"))){for(e=e.childNodes[0];e&&"COL"!=e.tagName;)e=e.nextSibling;e&&(e.style.width=d.style.width,d.firstChild.style.width=d.style.width)}}else if(d=d[d.length-1],d.style.width=Math.max(b-this._frozenWidth,0)+"px",a.style.width=b+"px",this._processColGroup()&&(e=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"COLGROUP"))){for(e=e.childNodes[e.childNodes.length-1];e&&"COL"!=e.tagName;)e=
e.previousSibling;e&&(e.style.width=d.style.width,d.firstChild.style.width=d.style.width)}}}};
AdfDhtmlTableBasePeer.prototype._registerInnerScrollCallback=function(a){if(this._hasFrozenColumn()){AdfAssert.assert(null!=a.rows&&null!=a.rows[0],"Unable to register inner scroll callback when the block contains no rows!");var b=a.rows[0].cells,d=b.length;if(!this._areAllColumnsFrozen(d))for(var e=0;e<a.rows.length;e++)b=a.rows[e].cells,b=this._freezeColumnsToEnd()?b[0]:b[d-1],AdfDhtmlTableBasePeer.FindFirstChildByTagName(b,"DIV").onscroll=this._innerTableScrollCallback}};
AdfDhtmlTableBasePeer.prototype._getNestedScrolledTable=function(a){AdfAssert.assert(null!=a,"Unable to get the nested scrolled table without a valid row passed in!");a=a.cells;a=this._freezeColumnsToEnd()?a[0]:a[a.length-1];a=AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"DIV");return AdfDhtmlTableBasePeer.FindFirstChildByTagName(a,"TABLE")};AdfDhtmlTableBasePeer._isRTL=function(){return AdfPage.PAGE.getLocaleContext().isRightToLeft()};
AdfDhtmlTableBasePeer.prototype._getExpandAction=function(a){var b=AdfPage.PAGE.getLookAndFeel(),d=b.getStyleClass(AdfDhtmlTableBasePeer._ICON_STYLE_EXPANDED),e=a.parentNode.className;if(d==a.className||d==e)return"collapse";b=b.getStyleClass(AdfDhtmlTableBasePeer._ICON_STYLE_COLLAPSED);return b==a.className||b==e?"expand":null};AdfDhtmlTableBasePeer.prototype.ComponentScrollTopChanged=function(a,b,d,e){this.scrollToPos(-1,d,!0);return!1};
AdfDhtmlTableBasePeer.prototype.ComponentScrollLeftChanged=function(a,b,d,e){this.scrollToPos(d,-1,!0);return!1};AdfDhtmlTableBasePeer.prototype.ComponentDisclosedRowKeysChanged=function(a,b,d,e){this._savedDisclosedState=e;a=AdfCollections.removeAll(e,d);d=AdfCollections.removeAll(d,e);b=e=!1;null==a||AdfCollections.isEmpty(a)||(this.HandleComponentCollapseEvent(a),e=!0);null==d||AdfCollections.isEmpty(d)||(this.HandleComponentExpandEvent(a),b=!0);AdfAssert.assert(!(e&&b))};
AdfDhtmlTableBasePeer.prototype.HandleComponentCollapseEvent=function(a){this._queueCollapseFetchEvent()};AdfDhtmlTableBasePeer.prototype.HandleComponentExpandEvent=function(a){this._queueExpandFetchEvent()};
AdfDhtmlTableBasePeer.prototype._changeDetailIcon=function(a,b){for(var d=AdfAgent.AGENT,e=null,f=a.cells,g=0;g<f.length;g++)if(d.getAttribute(f[g],AdfDhtmlTableBasePeer._DETAIL_COLUMN_MARKER,!1)){e=f[g];break}if(e){if(d=AdfDhtmlTableBasePeer.FindFirstChildByTagName(e,"A"))f=b?AdfDhtmlTableBasePeer._ICON_STYLE_EXPANDED:AdfDhtmlTableBasePeer._ICON_STYLE_COLLAPSED,e=AdfPage.PAGE.getLookAndFeel(),f=e.getStyleClass(f),d.className=f,e=b?e.getTranslatedString(AdfDhtmlTableBasePeer._EXPANDED_NODE_KEY):e.getTranslatedString(AdfDhtmlTableBasePeer._COLLAPSED_NODE_KEY),
d.title=e;(d=this._getDisclosureIcon(d))&&AdfDomUtils.swapIcon(d,b?AdfDhtmlTableBasePeer._ICON_EXPANDED:AdfDhtmlTableBasePeer._ICON_COLLAPSED)}};AdfDhtmlTableBasePeer.prototype._getDisclosureIcon=function(a){var b=AdfAgent.getAgent();return null!=a.firstChild&&(a=a.firstChild,b=b.getNodeName(a).toLowerCase(),"img"==b||"span"==b||"#text"==b)?a:null};AdfDhtmlTableBasePeer.prototype._getEstimatedRowCount=function(a){return AdfAgent.getAgent().getIntAttribute(a,"_estRowCount",-1)};
AdfDhtmlTableBasePeer._getBlockRowCount=function(a){var b=0,d=AdfAgent.getAgent();if(d.getAttribute(a,AdfDhtmlTableBasePeer._HAS_DETAIL_MARKER,!1)){a=a.rows;for(var e=0;e<a.length;e++)d.getAttribute(a[e],AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)||b++}else return a.rows.length;return b};
AdfDhtmlTableBasePeer.prototype.__isOwnComponentEvent=function(a){a=a.getSource();for(var b=this.getComponent(),d=!1,e=null!=AdfPage.PAGE.getDomWindow().AdfUITree;!d&&a;)if(a==b)d=!0;else{if(a instanceof AdfUITable||e&&a instanceof AdfUITree||a instanceof AdfUIPopup)break;a=a.getParent()}return d};AdfDhtmlTableBasePeer.prototype._isClickToEdit=function(){return this.getComponent().getEditingMode()==AdfDhtmlTableBasePeer._EDIT_MODE_CLICKTOEDIT};AdfDhtmlTableBasePeer.prototype._getActiveRowKey=function(){return this.getComponent().getProperty("_afrActiveRowKey")};
AdfDhtmlTableBasePeer.prototype.ComponentActiveRowKeyChanged=function(a,b,d,e){this._setActiveRowKey(d);return!1};
AdfDhtmlTableBasePeer.prototype._setActiveRowKey=function(a){if(AdfTableDataFetchEvent.CLICK_EDIT_ACTIVE_ROW!=this._pendingFetch&&!this._ignoreActiveRowKeyChange){var b=null;this._ignoreActiveRowKeyChange=!0;try{var d=this.getComponent(),e=d.getProperty("_afrActiveRowKey");d.setProperty("_afrActiveRowKey",a,!1,AdfUIComponent.PROPAGATE_ALWAYS);d.setProperty("activeRowKey",a,!1,AdfUIComponent.PROPAGATE_ALWAYS);d.getProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY)&&delete e;d.setProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY,
null,!1,AdfUIComponent.PROPAGATE_ALWAYS);this._remainReadOnly?d.setProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY,!0,!1,AdfUIComponent.PROPAGATE_ALWAYS):d.setProperty(AdfDhtmlTableBasePeer._REMAIN_READ_ONLY,!1,!1,AdfUIComponent.PROPAGATE_ALWAYS);if(!this._isPaged&&null==d.getProperty("scrollTopRowKey")){var f=this.GetFirstVisibleRowKeyAndRow();null!=f.rowKey&&d.setProperty("scrollTopRowKey",f.rowKey,!0,AdfUIComponent.PROPAGATE_ALWAYS)}delete this._remainReadOnly;b=this._queueFetchEvent(!1,AdfTableDataFetchEvent.CLICK_EDIT_ACTIVE_ROW,
-1,a);e&&b?(b.setOldClientKey(e),this._oldActiveRowKey=e):b||(d.setProperty("_afrActiveRowKey",e,!1,AdfUIComponent.PROPAGATE_ALWAYS),d.setProperty("activeRowKey",e,!1,AdfUIComponent.PROPAGATE_ALWAYS))}finally{this._ignoreActiveRowKeyChange=!1}return b}};
AdfDhtmlTableBasePeer.prototype._restoreActiveRowKey=function(){this._ignoreActiveRowKeyChange=!0;try{var a=this.getComponent();a.setProperty("_afrActiveRowKey",this._oldActiveRowKey,!1,AdfUIComponent.PROPAGATE_NEVER);a.setProperty("activeRowKey",this._oldActiveRowKey,!1,AdfUIComponent.PROPAGATE_NEVER);delete this._oldActiveRowKey}finally{this._ignoreActiveRowKeyChange=!1}};
AdfDhtmlTableBasePeer.prototype._getCellAndIndexForNode=function(a,b){for(var d=AdfAgent.AGENT,e=this.getDomElement(),f=null,g=-1,h=null;null!=a&&a!=e&&-1==g;)if("TD"==d.getNodeName(a)){var k=a.parentNode;if(k==b){g=this._freezeColumnsToEnd()?this._firstFrozen+this._indexOfDomElement(b.cells,a)-1:this._indexOfDomElement(b.cells,a);h=a;break}else if(this._hasFrozenColumn()&&(null==f&&(f=this._getNestedScrolledTable(b).rows[0]),k==f)){this._freezeColumnsToStart()?g=this._lastFrozen+this._indexOfDomElement(f.cells,
a)+1:this._freezeColumnsToEnd()&&(g=this._indexOfDomElement(f.cells,a));h=a;break}a=k}else a=a.parentNode;return{cellIndex:g,cell:h}};AdfDhtmlTableBasePeer.prototype._saveClickToEditRequest=function(a,b){var d=this._getCellAndIndexForNode(a,b),e={};e.cellIndex=d.cellIndex;this._clickEditRequest=e};
AdfDhtmlTableBasePeer.prototype._processClickToEditRequest=function(a){var b=AdfAgent.AGENT,d=this._clickEditRequest;if(d&&-1!==d.cellIndex){this._ignoreRowClick&&(this._ignoreRowClick=!1);var e=this._getActiveRowKey();this._lastCTEIndex=d?d.cellIndex:void 0;if(e){var f=this.FindRowByKey(e);if(f){f=f.tr;AdfAssert.assertDomElement(f);if(!d||d.activateCellType)if(this._grabFocus(),d&&"last"==d.activateCellType)for(b=this.__getVisibleLeafColumns().length-1;0<=b;){d=AdfDomUtils.getInputElementsInNode(this.FindCellByIndex(f,
b));if(0<d.length){AdfFocusUtils.focusElement(d[d.length-1]);break}b--}else this._setFocusOnEditableElementInNode(b,f);else{d=this.FindCellByIndex(f,d.cellIndex);AdfAssert.assertDomElement(d);if(b.getPlatform()==AdfAgent.IE_PLATFORM){var g=this._getFirstInputElementInNode(b,d);g||(g=this._getFirstInputElementInNode(b,f));g&&this._grabFocus()}else this._grabFocus();null==this._setFocusOnEditableElementInNode(b,d)&&null==this._setFocusOnEditableElementInNode(b,f)&&this._setFocusOnNode(d)}a&&this._isRowSelectionEnabled()&&
!this._selIsSelected(e)&&(this._selUnselectAll(),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,e,f),this._selSelectRow(e,f));this._clickEditRequest&&delete this._clickEditRequest;this._processClickToEditRequestTimerId&&delete this._processClickToEditRequestTimerId}}}};
AdfDhtmlTableBasePeer.prototype._handleTabKey=function(a,b){var d=this.GetRowKeyAndRow(a,this.getDomElement()),e=b.shiftKey,f=!0;if(null!=d){var g=d[1];if(null!=g){var h=this._getCellAndIndexForNode(a,g),k=h.cell;if(k){var l=h.cellIndex;this._ctePatternStart||0==this._ctePatternStart||(this._ctePatternStart=l);if(this._isClickToEdit()&&null!=this._getActiveRowKey()){var k=AdfDomUtils.getInputElementsInNode(k),m=k.length;if(0<m)if(!e&&AdfDomUtils.isAncestorOrSelf(k[m-1],a)){if(this._hasDetailStamp&&
(e=g.nextSibling)&&AdfAgent.AGENT.getAttribute(e,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)&&(k=AdfDomUtils.getInputElementsInNode(e),0<k.length))return!0;h=this.__getVisibleLeafColumns();h=h.length;e=l>=h-1;if(!e){for(l++;l<h;){k=AdfDomUtils.getInputElementsInNode(this.FindCellByIndex(g,l));if(0<k.length)break;l++}e=l==h}if(e){if(f=AdfRichUIPeer.getFirstAncestorComponent(a))g=f.getPeer(),g.RunValidation&&g.RunValidation(f,a);this._clickToEditActivateRow(d[0],!0);f=!this._clickEditRequest}}else if(e&&
AdfDomUtils.isAncestorOrSelf(k[0],a)){l=0==h.cellIndex;if(!l){for(l=h.cellIndex-1;0<=l;){k=AdfDomUtils.getInputElementsInNode(this.FindCellByIndex(g,l));if(0<k.length)break;l--}l=-1==l}l&&(this._clickToEditActivateRow(d[0],!1),f=!this._clickEditRequest)}}else h=this.__getVisibleLeafColumns(),h=h.length,(e?0==l&&g.previousElementSibling&&AdfFocusUtils.isTabStop(g.previousElementSibling):l>=h-1&&g.nextElementSibling&&AdfFocusUtils.isTabStop(g.nextElementSibling))?(g=e?g.previousElementSibling.lastElementChild:
g.nextElementSibling.firstElementChild,d=this.GetRowKeyAndRow(g,this.getDomElement()),this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,d[0],g)):(g=e?k.previousElementSibling:k.nextElementSibling)&&AdfFocusUtils.isTabStop(g)&&this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,d[0],d[1],g)}}}else if(!e&&this._hasDetailStamp&&this._isClickToEdit())return this._handleTabKeyInCTEDetailRegion(a);return f};
AdfDhtmlTableBasePeer.prototype._handleTabKeyInCTEDetailRegion=function(a){for(var b=this.getDomElement(),d=a.parentNode,e=AdfAgent.AGENT,f=!0;d&&d!=b;){if("TR"==e.getNodeName(d)&&e.getAttribute(d,AdfDhtmlTableBasePeer._DETAIL_ROW_MARKER,!1)){elems=AdfDomUtils.getInputElementsInNode(d);0<elems.length&&elems[elems.length-1]==a&&(a=e.getAttribute(d.previousSibling,AdfDhtmlTableBasePeer._ROW_KEY),this._clickToEditActivateRow(a,!0),f=!1);break}d=d.parentNode}return f};
AdfDhtmlTableBasePeer.prototype._clickToEditActivateRow=function(a,b,d){delete this._lastRowKeyInView;var e=b?this._getNextRowKeyAndRow(a):this._getPreviousRowKeyAndRow(a);if(!e.isAtTop){var f=e.rowKey,g=e.lastRowKeyInView;if(null!=f)this._setActiveRowKey(f),this._selUnselectAll(),this._selSelectRow(f,e.row),this._unclipRow(e.row),this._clickEditRequest=void 0!=d?{cellIndex:d}:{activateCellType:b?"first":"last"},b=AdfPage.PAGE.getActiveDomElement(),g=this.getComponent().getProperty("activeRowKey"),
a!=g&&b&&b.blur&&b.blur();else if(null!=g){a=this.GetScroller();if(!this._hasSingleScroller()||this._isPaged)a=a[AdfDhtmlTableBasePeer._VSCROLLER];d=this._currentScrollTop+(b?this._averageRowHeight:-this._averageRowHeight);0<d&&d<this._getScrollHeight()&&(this._lastRowKeyInView=g,this._getScrollerClientHeight()+d<this._getScrollHeight()&&(AdfAgent.AGENT.scrollToPos(a,null,d),this._clickEditRequest={activateRowType:b?"next":"previous"}))}}return null!=e.rowKey};
AdfDhtmlTableBasePeer.prototype._processClickToEditActivateRequest=function(){var a=this._clickEditRequest;if(a&&a.activateRowType){var b="next"==a.activateRowType;attrs=b?this._getNextRowKeyAndRow(this._lastRowKeyInView):this._getPreviousRowKeyAndRow(this._lastRowKeyInView);a.activateCellType=b?"first":"last";attrs.rowKey&&this._setActiveRowKey(attrs.rowKey);delete this._lastRowKeyInView}};
AdfDhtmlTableBasePeer.prototype._restoreScrollPosition=function(){var a=this.getComponent().getScrollLeft();0<=a&&this.scrollToPos(a,-1,!0)};
AdfDhtmlTableBasePeer.prototype._unclipInputElem=function(a){var b=AdfAgent.AGENT,d=this.GetScroller();if(d){var e=this._getCellIndex(a);if(!this._hasFrozenColumn()||!this._isColumnFrozen(e)){if(!this._hasSingleScroller()||this._isPaged)d=d[AdfDhtmlTableBasePeer._HSCROLLER];var e=b.getElementLeft(a),f=b.getElementLeft(d);(AdfDhtmlTableBasePeer._isRTL()?e+a.offsetWidth<d.scrollWidth-(this.__getScrollLeft()+d.clientWidth):e+a.offsetWidth>f+d.clientWidth)&&b.scrollToPos(d,this._currentScrollLeft+(a.offsetWidth+
e-(f+d.clientWidth)),null)}}};
AdfDhtmlTableBasePeer.prototype.scrollColumnIntoView=function(a,b){AdfAssert.assert(null!=a||null!=b);var d=AdfAgent.AGENT;if(!b&&(b=d.getElementById(a),!b))return;var e=d.getIntAttribute(b,"_d_index",-1);if(!this._isColumnFrozen(e)){e=this.GetScroller();if(!this._hasSingleScroller()||this._isPaged)e=e[AdfDhtmlTableBasePeer._HSCROLLER];var f=b.offsetLeft;if(f!=this._currentScrollLeft){var g=this._colScrollAnimationDuration;void 0==g&&(g=AdfPage.PAGE,this._colScrollAnimationDuration=g=g.isAnimationEnabled()?
parseInt(g.getLookAndFeel().getSkinProperty("af|table-tr-column-scroll-animation-duration")):0);0<g?AdfDhtmlElementAnimator.animate(AdfDhtmlElementAnimator.FRAME_METHOD_SLOW_FAST_SLOW,g,[{element:e,properties:{scrollLeft:f}}],null,null,null):d.scrollToPos(e,f,null)}}};AdfDhtmlTableBasePeer.prototype.getRowIndex=function(a){AdfAssert.assertString(a);AdfAssert.assert(null!=a,"Row Key cannot be null");var b=-1;if(a=this.FindRowByKey(a))b=a.index;return b};
AdfDhtmlTableBasePeer.prototype.getRowKey=function(a){AdfAssert.assertNumber(a);AdfAssert.assert(0<=a,"index must be greater than or equal to 0");for(var b=null,d=this.GetDataBody().childNodes,e=d.length,f=0;f<e;f++){var g=d[f],h=g.startRow;if(a>=h&&a<h+g.numRows)for(var g=g.rows,h=a-h,k=0,l=0;k<g.length;k++)if(b=AdfAgent.AGENT.getAttribute(g[k],AdfDhtmlTableBasePeer._ROW_KEY)){if(l==h)break;++l}}return b};
AdfDhtmlTableBasePeer.prototype._clearColumnSelectionEventAddedSet=function(){this._colSelEventSelectedColIds={}};AdfDhtmlTableBasePeer.prototype._clearColumnSelectionEventRemovedSet=function(){this._colSelEventUnselectedColIds={}};AdfDhtmlTableBasePeer.prototype._clearColumnSelectionEventChangedSets=function(){this._colSelEventSelectedColIds={};this._colSelEventUnselectedColIds={}};
AdfDhtmlTableBasePeer.prototype._hasColumnSelectionEventChangedSets=function(){return!AdfCollections.isEmpty(this._colSelEventSelectedColIds)||!AdfCollections.isEmpty(this._colSelEventUnselectedColIds)};AdfDhtmlTableBasePeer.prototype._queueColumnSelectionEvent=function(){if(this._hasColumnSelectionEventChangedSets()){var a=this.getComponent();AdfTableUtils.queueColumnSelectionEvent(a,this._colSelEventSelectedColIds,this._colSelEventUnselectedColIds);this._clearColumnSelectionEventChangedSets()}};
AdfDhtmlTableBasePeer.prototype.ConvertClientIdToLocator=function(a,b,d,e){var f=this.__getColumnHeader();if(f&&(b=b.getPeer().getDomElement())&&AdfDomUtils.isAncestor(f,b))return;f=a.getClientId();a=AdfStrings.count(f,":");AdfAssert.assert(0<=d.indexOf(f));d=d.substring(f.length+1);f=d.indexOf(":");0<f&&(d=d.substring(0,f),d=this.FindRowByKey(d),e.push([a+1,d?d.index:null]))};
AdfDhtmlTableBasePeer.prototype.convertLocatorToClientId=function(a,b){var d=a.getClientId(),e=this.getRowKey(b);return e?d+":"+e:null};
AdfDhtmlTableBasePeer.prototype._computeAutoHeight=function(){var a=AdfAgent.AGENT,b=0,d=this._autoHeightRows;if(0<d){var e=a.getPlatform()==AdfAgent.GECKO_PLATFORM,f=a.getPlatform()==AdfAgent.IE_PLATFORM,g=this.GetFirstVisibleRowKeyAndRow().row;if(g)for(var h=this.GetDataBody().childNodes,k=h.length,l=0,m=0,n=0;n<k&&l<d;n++){var m=n,q=h[n],r=q.rows,t=0;null!=r&&(t=r.length);if(f&&"page"==this.getComponent().getProperty("scrollPolicy"))b=q.offsetHeight;else for(q=0;q<t&&l<d;q++)if(g===r[q]||0<l){l++;
var u;e?(u=a.getComputedStyle(r[q]),u=parseFloat(u.height)):u=f?r[q].getBoundingClientRect().height:r[q].offsetHeight;b+=u}}if(l!=d&&0<l)for(f=!1,n=m;0<=n;n--)for(q=h[n],r=q.rows,t=0,null!=r&&(t=r.length),q=t-1;0<=q&&l<d;q--)g===r[q]?f=!0:f&&(l++,e?(u=a.getComputedStyle(r[q]),u=parseFloat(u.height)):u=r[q].offsetHeight,b+=u)}return e?Math.round(b):b};
AdfDhtmlTableBasePeer.prototype._setOuterHeightForBodyHeight=function(a){var b=this.getDomElement(),d=this._getScrollbarHeight(),d=a+this._cachedCHHeight+this._cachedCFHeight+this._cachedNBHeight+d;this._sizeOuterContainer(b,d);if(!this.IsEmpty){var e=AdfAgent.getAgent(),f=e.getPlatform()==AdfAgent.IE_PLATFORM;this._restoreHorizontalScrollBarForIE8();this._setScrollerHeight(d,this._cachedCHHeight,this._cachedCFHeight,this._cachedNBHeight);d=this._getScrollbarHeight();this._setScrollerWidth(b.clientWidth,
this._frozenWidth);f&&8>e.getVersion()&&this._setFakeCanvasHeight(this._canvasHeight);e=this._getScrollbarHeight();d!=e&&(d=a+this._cachedCHHeight+this._cachedCFHeight+e,this._sizeOuterContainer(b,d),this._setScrollerHeight(d,this._cachedCHHeight,this._cachedCFHeight,this._cachedNBHeight));this.SizeDataBody(this.GetDataBody(),b.clientWidth,b.clientHeight)}};
AdfDhtmlTableBasePeer.prototype._sizeOuterContainer=function(a,b){var d=AdfAgent.AGENT;if("border-box"==d.getBoxSizing(a)){var e=AdfAgent.getCSSLengthAsInt,d=d.getComputedStyle(a);b=b+e(d.paddingTop)+e(d.paddingBottom)+e(d.marginTop)+e(d.marginBottom)+e(d.borderTopWidth)+e(d.borderBottomWidth)}a.style.height=b+"px";a.style.minHeight&&parseFloat(a.style.minHeight)>b&&(a.style.minHeight=b+"px")};
AdfDhtmlTableBasePeer.prototype.AdjustAutoHeight=function(){var a=this.GetPanelCollectionPeer(),b=this.GetDataBody(),d=this.getDomElement(),e=d.clientHeight;if(a&&a.isDetached())this.__fixPanelCollectionDimensions(!0),this.SizeDataBody(b,d.clientWidth,e),this.IsEmpty||this._setScrollerHeight(e,this._cachedCHHeight,this._cachedCFHeight,this._cachedNBHeight);else if(this.isHeightAutoSized()&&!this.BusyAnimating()){var f=this.GetFirstVisibleRowKeyAndRow(),g;this.IsEmpty?g=b.offsetHeight:(g=this._computeAutoHeight(),
0!==g||f.rowKey||(g=b.offsetHeight));f=AdfAgent.AGENT;f=f.getPlatform()==AdfAgent.IE_PLATFORM&&9>f.getVersion()&&7<f.getVersion();if(this.IsEmpty||g!=b.offsetHeight||f&&2>this.GetRowCount())this._setOuterHeightForBodyHeight(g),d=d.clientHeight,a&&this.__fixPanelCollectionDimensions(!1),e!=d&&(a=AdfPage.PAGE,a.scheduleTimer(a,a.doResizeNotify,null,0,{isSynchronized:!0}));this._checkAutoHeightScrollbar(b);this._stretchingTheColumns||this._desendentResizeQueued||this._doStretch()}};
AdfDhtmlTableBasePeer.prototype._queueDescendantResize=function(){if(!this._desendentResizeQueued){this._desendentResizeQueued=!0;try{AdfPage.PAGE.__queueDescendantResizeNotifySource(this.getComponent()),AdfPage.PAGE.__doDescendantResizeNotify()}finally{delete this._desendentResizeQueued}}};AdfDhtmlTableBasePeer.prototype._doStretch=function(a){a=this._totalWidth;this._stretchTheColumns();this._totalWidth!=a&&this._queueDescendantResize();return-1};
AdfDhtmlTableBasePeer.prototype._checkAutoHeightScrollbar=function(a){var b=a.childNodes,d=this._autoHeightRows,e=b.length,f=this._getRowCountWithDisclosedDetailStampRow(a);this._allRowsAvailableOnClient(b,e)&&f<=d&&(b=this._getScrollerClientHeight(),b!=this._canvasHeight&&(this._canvasHeight=b,this._setFakeCanvasHeight(b),b=this.getDomElement(),this._setScrollerWidth(b.clientWidth,this._frozenWidth),this.SizeDataBody(a,b.clientWidth,b.clientHeight)))};
AdfDhtmlTableBasePeer.prototype._getRowCountWithDisclosedDetailStampRow=function(a){var b=0;if(this._hasDetailStamp){a=a.childNodes;for(var d=a.length,e=0;e<d;e++){var f=null;null!=a[e]&&(f=a[e].rows);null!=f&&(b+=f.length)}}else b=this.GetRowCount();return b};AdfDhtmlTableBasePeer._maxMessageType=function(a){AdfAssert.assertString(a);a=AdfPage.PAGE.getMessages(a);for(var b=AdfFacesMessage.TYPE_INFO,d=0;d<a.length;d++)b=Math.max(b,AdfFacesMessage.getTypeFromMessage(a[d]));return b};
AdfDhtmlTableBasePeer.prototype._getRTLScrollAdjustment=function(){var a=AdfAgent.getAgent(),b=a.getPlatform();if(b==AdfAgent.IE_PLATFORM&&7<a.getVersion()||b==AdfAgent.WEBKIT_PLATFORM){a=this.GetScroller();if(!this._footerless||this._isPaged)a=a[AdfDhtmlTableBasePeer._HSCROLLER];return a.scrollWidth-a.clientWidth-this._currentScrollLeft}return this._currentScrollLeft};
AdfDhtmlTableBasePeer.prototype.DescendantMessageChanged=function(){var a=this.getDomElement(),b=AdfAgent.AGENT,d=this.getComponent().getClientId(),e=this._rowKeysWithMessages;e||(this._rowKeysWithMessages=e=[]);for(var f=AdfPage.PAGE.getClientIdsWithMessages(d),d={},g={},h=0;h<f.length;h++){var k=f[h],l=AdfDhtmlTableBasePeer._maxMessageType(k);if(k=b.getElementById(k))if(k=this.GetRowKeyAndRow(k,a)){var m=k[0];if(k=this.GetRowHeaderCellFromRow(k[1])){var n=AdfCollections.indexOf(e,m);-1==n&&(n=e.push(m)-
1);d[n]=Math.max(l,d[n]?d[n]:-1);g[n]=k}}}for(h=e.length-1;-1<h;h--)if(m=e[h],d[h])k=g[h],f=b.getExpandoProperty(k,AdfDhtmlTableBasePeer._MAX_ROWHEADER_MSGTYPE_EXPANDO,-1),a=d[h],f!=a&&(-1<f&&AdfMessageUtils.removeCSSClassName(k,f),b.setExpandoProperty(k,AdfDhtmlTableBasePeer._MAX_ROWHEADER_MSGTYPE_EXPANDO,a),AdfMessageUtils.addCSSClassName(k,a));else if(a=this.FindRowByKey(m)){if(k=this.GetRowHeaderCellFromRow(a.tr))f=b.getExpandoProperty(k,AdfDhtmlTableBasePeer._MAX_ROWHEADER_MSGTYPE_EXPANDO,-1),
AdfMessageUtils.removeCSSClassName(k,f),b.setExpandoProperty(k,AdfDhtmlTableBasePeer._MAX_ROWHEADER_MSGTYPE_EXPANDO,-1),AdfCollections.removeArrayKey(e,h)}else AdfCollections.removeArrayKey(e,h)};AdfDhtmlTableBasePeer.prototype.ApplyTooltipTitle=function(a){var b=this._getOnlyTextNode(a);b&&this._isCellTruncated(a)&&a.setAttribute("title",b.nodeValue)};
AdfDhtmlTableBasePeer.prototype._getParentMatchingId=function(a,b){for(var d=a,e=null,f=this.getDomElement();!e&&d&&d!=f.parent&&1==d.nodeType;)if(d.id&&0<=d.id.indexOf(b)){e=d;break}else d=d.parentNode;return e};
AdfDhtmlTableBasePeer.prototype._resizeNavBar=function(a,b){var d=!1;a<this._cachedNBWidth&&!this._nbarMin?d=this._nbarMin=!0:a>=this._cachedNBWidth&&this._nbarMin&&(this._nbarMin=!1,d=!0);if(d){var d=AdfAgent.AGENT,e=this.getComponent().getClientId(),f=AdfRichUIPeer.CreateSubId(e,AdfDhtmlTableBasePeer._NAVBAR_RANGE_TEXT),f=d.getElementById(f),e=AdfRichUIPeer.CreateSubId(e,AdfDhtmlTableBasePeer._NAVBAR_PAGE_CNT),d=d.getElementById(e);this._nbarMin?(d.style.display="none",f.style.display="none"):(d.style.display=
"",f.style.display="")}};
AdfDhtmlTableBasePeer.prototype.__handleNavBarItemsClick=function(a,b){var d=!1;if(this._isNavBarLink(b,AdfDhtmlTableBasePeer._NAVBAR_PREVIOUS))-1<this._isLinkDisabled(b)||(this._handlePrevClick(a),d=!0);else if(this._isNavBarLink(b,AdfDhtmlTableBasePeer._NAVBAR_NEXT))-1<this._isLinkDisabled(b)||(this._handleNextClick(a),d=!0);else if(this._isNavBarLink(b,AdfDhtmlTableBasePeer._NAVBAR_FIRST))-1<this._isLinkDisabled(b)||(this._handleFirstClick(a),d=!0);else{var e=this._getNavBarPageRow(b,AdfDhtmlTableBasePeer._NAVBAR_LAST);
null!=e?-1<this._isLinkDisabled(b)||(this._handlePageRowClick(e,a),d=!0):(e=this._getNavBarPageRow(b,AdfDhtmlTableBasePeer._NAVBAR_PAGE),null!=e&&(this._handlePageRowClick(e,a),d=!0))}d&&AdfDomUtils.addCSSClassName(b,"p_AFActivated")};AdfDhtmlTableBasePeer.prototype._isLinkDisabled=function(a){return a.className.indexOf("p_AFDisabled")};
AdfDhtmlTableBasePeer.prototype.__handleLoadMoreItemsClick=function(a,b){var d=this.getComponent(),e=b.id;e==AdfRichUIPeer.CreateSubId(d.getClientId(),AdfDhtmlTableBasePeer._LOAD_MORE_BOTTOM_LINK)?this._loadMoreFetch(!0):e==AdfRichUIPeer.CreateSubId(d.getClientId(),AdfDhtmlTableBasePeer._LOAD_MORE_TOP_LINK)&&this._loadMoreFetch(!1)};
AdfDhtmlTableBasePeer.prototype._loadMoreFetch=function(a){var b=this.GetDataBody().childNodes,d=b.length;if(a){if(a=b[d-1],b=a.startRow+a.numRows,d=this.GetRowCount(),0<d&&b<d||0>d)--b,a=this._getBlockLastRowKey(a),this._startFetch(AdfTableDataFetchEvent.AFTER_KEY_SUBTYPE,b,a,null,!1)}else a=b[0],b=a.startRow,a=this._getBlockFirstRowKey(a),this._startFetch(AdfTableDataFetchEvent.BEFORE_KEY_SUBTYPE,b,a,null,!1)};
AdfDhtmlTableBasePeer.prototype._updateLoadMoreItemsRangeText=function(a,b,d,e){if(!this._isImplicitLoadMore){var f=AdfPage.PAGE.getLookAndFeel(),g=this.getComponent(),h=this._getLoadMore(e);e=AdfRichUIPeer.CreateSubId(g.getClientId(),e?AdfDhtmlTableBasePeer._LOAD_MORE_RNG_TOP_TEXT:AdfDhtmlTableBasePeer._LOAD_MORE_RNG_BOTTOM_TEXT);a=parseInt(a)+1;h=h.childNodes[0].childNodes;for(g=0;g<h.length;g++)if(null!=h[g].id&&-1!=h[g].id.indexOf(e)){e=null;e=0<this.GetRowCount()&&0<d?f.getTranslatedString("af_table.LABEL_ITEM_RANGE_KNOWN_COUNT",
new String(a),new String(b),new String(d)):f.getTranslatedString("af_table.LABEL_ITEM_RANGE_UNKNOWN_COUNT",new String(a),new String(b));h[g].childNodes[0].nodeValue=e;break}}};AdfDhtmlTableBasePeer.prototype.GetFirst=function(){return this.getComponent().getFirst()};AdfDhtmlTableBasePeer.prototype.RegisterFirstPropertyChange=function(){AdfRichUIPeer.addComponentPropertyChanges(AdfDhtmlTablePeer,"first")};AdfDhtmlTableBasePeer.prototype.GetRows=function(){return this.getComponent().getRows()};
AdfDhtmlTableBasePeer.prototype.ComponentFirstChanged=function(a,b,d,e){this.QueueRangeChangeEvent(e,d);this._isPaged&&AdfPage.PAGE.addPartialTargets(a);return!1};AdfDhtmlTableBasePeer.prototype.ComponentRowsChanged=function(a,b,d,e){AdfRangeChangeEvent.queue(a,(0).toString(),parseInt(e).toString(),(0).toString(),parseInt(d).toString());this._isPaged&&AdfPage.PAGE.addPartialTargets(a);return!1};
AdfDhtmlTableBasePeer.prototype.QueueRangeChangeEvent=function(a,b){var d=this.getComponent(),e=parseInt(this.GetRows()),f=parseInt(a),g=f+e-1,h=parseInt(b);AdfRangeChangeEvent.queue(d,f.toString(),g.toString(),h.toString(),(h+e-1).toString())};AdfDhtmlTableBasePeer.prototype._isNavBarLink=function(a,b){var d=AdfRichUIPeer.CreateSubId(this.getComponent().getClientId(),b);return null!=this._getParentMatchingId(a,d)};
AdfDhtmlTableBasePeer.prototype._getNavBarPageRow=function(a,b){var d=AdfRichUIPeer.CreateSubId(this.getComponent().getClientId(),b),e=this._getParentMatchingId(a,d);if(null!=e)return e.id.substring(d.length)};AdfDhtmlTableBasePeer.prototype._handlePrevClick=function(a){var b=parseInt(this.GetFirst()),d=parseInt(this.GetRows()),b=Math.max(b-d,0);this.QueueRangeChangeEvent(this.GetFirst(),b);AdfPage.PAGE.addPartialTargets(this.getComponent());AdfAgent.AGENT.eatEvent(a)};
AdfDhtmlTableBasePeer.prototype._handleFirstClick=function(a){this.QueueRangeChangeEvent(this.GetFirst(),0);AdfPage.PAGE.addPartialTargets(this.getComponent());AdfAgent.AGENT.eatEvent(a)};AdfDhtmlTableBasePeer.prototype._handleNextClick=function(a){var b=parseInt(this.GetFirst()),d=parseInt(this.GetRows()),b=b+d;this.QueueRangeChangeEvent(this.GetFirst(),b);AdfPage.PAGE.addPartialTargets(this.getComponent());AdfAgent.AGENT.eatEvent(a)};
AdfDhtmlTableBasePeer.prototype._handlePageRowClick=function(a,b){this.QueueRangeChangeEvent(this.GetFirst(),a);AdfPage.PAGE.addPartialTargets(this.getComponent());AdfAgent.AGENT.eatEvent(b)};AdfDhtmlTableBasePeer.prototype.setBusy=function(a,b){AdfAgent.AGENT.supportsTransientStyleClasses()&&AdfDhtmlTableBasePeer.superclass.setBusy.call(this,a,b)};
AdfDhtmlTableBasePeer.prototype.setSelectedRowKeysWithoutEvent=function(a){this.suppressSelectionEventDelivery(!0);this.getComponent().setSelectedRowKeys(a);this.suppressSelectionEventDelivery(!1)};
AdfDhtmlTableBasePeer.prototype._addScrollEventListeners=function(a){var b=AdfAgent.AGENT,d=b.getPlatform();d==AdfAgent.IE_PLATFORM&&8<b.getVersion()||d==AdfAgent.GECKO_PLATFORM&&17<=b.getVersion()?a.addEventListener("wheel",AdfDhtmlTableBasePeer._handleMouseWheel,!0):a.onmousewheel=AdfDhtmlTableBasePeer._handleMouseWheel;d!=AdfAgent.IE_PLATFORM&&a.addEventListener("DOMMouseScroll",AdfDhtmlTableBasePeer._handleMouseWheel,!0);a.onscroll=this.createCallback(this._handleDataBodyScroll);AdfAgent.guessOS()==
AdfAgent.ANDROID_OS&&-1<navigator.userAgent.toLowerCase().indexOf("chrome")&&(this._touchMoveManager=b.createTouchMoveManager(a,this.createCallback(this._handleTouchMovement),1));this._isIOS13OrLater()&&(this._touchMoveManager=b.createTouchMoveManager(a,this.createCallback(this._handleTouchMovement),1));this._handleTouchEndCallback=this.createCallback(this._handleTouchEnd);b.addBubbleEventListener(a,"touchend",this._handleTouchEndCallback);(a=this.__getColumnHeader())&&b.addBubbleEventListener(a,
"touchend",this._handleTouchEndCallback)};AdfDhtmlTableBasePeer.prototype._handleTouchEnd=function(a){a._insideADFTable=1};AdfDhtmlTableBasePeer.prototype._isIOS13OrLater=function(){return"AdfSafariMobileAgent"==AdfAgent.AGENT.getTypeName()&&13<=parseFloat(AdfAgent.AGENT.getVersion())&&"Mac"==AdfAgent.AGENT.getOS()||13<=parseFloat(AdfAgent.AGENT.getVersion())&&"Mac"==AdfAgent.AGENT.getOS()&&this._isTouch};AdfDhtmlTableBasePeer.prototype._processColGroup=function(){return!0};
AdfDhtmlTableBasePeer._findHiddenLabel=function(a){if(a.id){a=AdfRichUIPeer.CreateSubId(a.id,AdfDhtmlEditableValuePeer._CONTENT_ID);var b=AdfAgent.AGENT.getElementById(a);if(b&&(b=b.nextElementSibling)&&"LABEL"==b.nodeName&&b.htmlFor==a)return b}return null};AdfDhtmlTableBasePeer.msgMap={update:"AFActiveDataTableRowUpdate",remove:"AFActiveDataTableRowDelete"};AdfDhtmlTableBasePeer.prototype.preventSwitchToEditableMode=function(){this._remainReadOnly=!0};
AdfDhtmlTableBasePeer.prototype.isInteger=function(a){return"number"===typeof a&&isFinite(a)&&Math.floor(a)===a};
AdfDhtmlTableBasePeer.prototype._getNextColumnFooterFocusElement=function(a){var b=AdfAgent.AGENT;if(a){for(var d=this._getSiblingDomNode(a,!0),e=this._resolveImmediateParentColumn(a),f=e;!d&&f;)f=null!=(d=this._getSiblingDomNode(e,!0))?this._resolveImmediateParentColumn(d):null;if(d)return(d?this._resolveImmediateParentColumn(d):null)!=e&&(e=this._resolveImmediateParentColumn(d))?e:d;a=b.getIntAttribute(a,"_d_index",-1);if(this._hasFrozenColumn()&&this._isColumnFrozen(a))return a=this._getColumnFooter(),
a=AdfDhtmlTableBasePeer.__getChildBySubId(a,"fd2"),AdfDhtmlTableBasePeer.__getChildBySubId(a,"ft2").rows[1].cells[0]}return null};
AdfDhtmlTableBasePeer.prototype._getPrevColumnFooterFocusElement=function(a){if(a){var b=AdfAgent.AGENT,d=this._resolveImmediateParentColumn(a);if(d&&"TH"==d.nodeName)return null;for(var e=this._getSiblingDomNode(a,!1),f=e?this._resolveImmediateParentColumn(e):null,g=d;!e&&g;)g=null!=(e=this._getSiblingDomNode(d,!1))?this._resolveImmediateParentColumn(e):null;if(null!=d&&d!=f&&!this._isTargetCellFilter(d))return d;if(null!=e)return this._resolveBotttomMostChildColumn(e);b.getIntAttribute(a,"_d_index",
-1);if(this._hasFrozenColumn()&&(a=this._getColumnFooter(),(a=AdfDhtmlTableBasePeer.__getChildBySubId(a,"ft"))&&a.rows&&(a=a.rows[1].cells,b=a.length,0<b)))return this._resolveBotttomMostChildColumn(a[b-1])}return null};AdfDhtmlTableBasePeer.prototype._setIndexedColumnFooterFocus=function(a,b,d){return this._footerless?!1:this._setFirstColumnFooterFocus(a,b,d)};
AdfDhtmlTableBasePeer.prototype._setFirstColumnFooterFocus=function(a,b,d){if(!this._footerless){var e=this._getColumnFooter();if(null==e)return!1;var f=AdfDhtmlTableBasePeer.__getChildBySubId(e,"ft"),f=f.rows[1].cells[d];this._hasFrozenColumn()&&!f&&(e=AdfDhtmlTableBasePeer.__getChildBySubId(e,"fd2"),f=AdfDhtmlTableBasePeer.__getChildBySubId(e,"ft2"),f=f.rows[1].cells[d-1]);if((d=null!=f.getAttribute(AdfDhtmlTableBasePeer._SELECT_ALL))||!a)return this._setFooterCellFocus(f),b||d||this._unclipColumnElement(f),
!0}return!1};AdfDhtmlTableBasePeer.prototype._setFooterCellFocus=function(a){var b=AdfDhtmlTableBasePeer._COLUMN_FOOTER_FOCUS_TYPE;this.UpdateFocusManager(b,null,a);return b};
AdfDhtmlTableBasePeer.prototype._handleColumnFooterArrow=function(a,b){switch(a){case AdfKeyStroke.ARROWRIGHT_KEY:var d=this._getNextColumnFooterFocusElement(this._focusManager.domElement);d&&(this._unclipColumnElement(d),this._setFooterCellFocus(d));break;case AdfKeyStroke.ARROWLEFT_KEY:if(d=this._getPrevColumnFooterFocusElement(this._focusManager.domElement))this._unclipColumnElement(d),this._setFooterCellFocus(d);break;case AdfKeyStroke.ARROWUP_KEY:if(this._focusManager.domElement){attrs=this._getLastVisibleRowKeyAndRow();
rowKey=attrs.rowKey;var d=attrs.row,e=this._isMultipleRowSelect();this._isRowSelectionEnabled()&&null!=rowKey&&(e||this._selUnselectAll(),this._selSelectRow(rowKey,d),this._unclipRow(d));this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,rowKey,d)}}};