if(typeof pln=='undefined'){alert("class_nvi_pagination_panel\nThis file required the PLN Javascript Library(pln.js)and it need to be loaded before this file.");}else if(typeof nvi=='undefined'){alert("class_nvi_pagination_panel\nThis file required the NVI CORE(nvi.core.js)and it need to be loaded before this file.");}else if(typeof class_nvi_basic_panel=='undefined'){alert("class_nvi_pagination_panel\nThis file required the Class Nvi Basic Panel and it need to be loaded before this file.");}else{function class_nvi_pagination_panel(){var _currentParams=null;var _linkCollection;var _controlViewId;var _disablePaginationUpdateOnViewUpdate=false;var _host=this;this.__constructor=function($id){void __super.__constructor($id);};this.toString=function(){return "Nvi Pagination Panel Class";};this.initialize=function(){var element=this.getElement();if(!pln.isHtmlElement(element))return;_linkCollection=element.nodeName.toLowerCase()=='a'?[element]:pln.node.getByName('a',this.getElement());if(pln.isArray(_linkCollection)){if(_linkCollection.length==0){void nvi.logManager.log('There is no A node in the following pagination container:'+this.getId(),'Report','class_nvi_pagination_panel','initialize');}for(var i=0;i<_linkCollection.length;i++){var element=_linkCollection[i];if(pln.isHtmlElement(element)){var url=element.href;var params=null;try{params=url.match(/\?.+/gi)[0].replace('?','');element.href="javascript:void(0);";element.title=params;void pln.events.addListener(element,'click',null,function(eventObject,parameters){if(pln.isString(parameters))_currentParams=parameters;if(pln.isString(_controlViewId)){var gridInstance=nvi.panelManager.getInstance(_controlViewId);if(!pln.isObject(gridInstance)){void nvi.logManager.log('The panel view linked with this pagination instance('+_host.getId()+')is not a panel instance,it may be null or undefined','Error','class_nvi_pagination_panel','initialize');}else{void gridInstance.updateView(_host.getSharedRessources());void nvi.eventManager.dispatchEvent(_host.getId(),nvi.eventManager.events.__changed);}}},params);}catch(errorObject){}}}}void __super.initialize();};this.terminate=function(){void __super.terminate();};this.deleteInstance=function(){void this.terminate();void __super.deleteInstance();};this.controlViewId=function(id){if(pln.isString(id)){_controlViewId=id;void nvi.eventManager.addListener(_controlViewId,nvi.eventManager.events.__updating,_host,_host.updateView);}};this.isChildOfView=function(){var isChild=false;var controledViewElement=null;try{controledViewElement=nvi.panelManager.getInstance(_controlViewId).getElement();}catch(errotObject){}var paginationElement=this.getElement();if(pln.isHtmlElement(controledViewElement)&&pln.isHtmlElement(paginationElement)){if(pln.node.isChildOf(paginationElement,controledViewElement))isChild=true;}return isChild;};this.onUpdatedView=function(success,serverData,message){void this.initialize();};this.updateView=function(){if(_disablePaginationUpdateOnViewUpdate)return;try{var ajaxData=nvi.panelManager.getInstance(_controlViewId).getAjaxData();_currentParams=ajaxData.parameters.parameters.currentParams;}catch(error){_currentParams=null;}if(!pln.isString(_currentParams))return;for(var i=0;i<_linkCollection.length;i++){var element=_linkCollection[i];if(pln.isHtmlElement(element))void pln.events.removeListener(element,'click',this,this.updateView);}if(pln.isString(_controlViewId)&&!this.isChildOfView()){_hideDefaultWaitingPanel=false;void __super.updateView(_host.getSharedRessources());}};this.getCurrentParams=function(){return _currentParams;};this.disablePaginationUpdateOnViewUpdate=function(){_disablePaginationUpdateOnViewUpdate=true;};this.getSharedRessources=function(){return{type:'pagination',id:this.getId(),parameters:{currentParams:this.getCurrentParams(),complementaryData:this.getComplementaryDataObject()}};};};class_nvi_pagination_panel.extend=class_nvi_basic_panel;}