Changeset 1515 for branches/3.0

Show
Ignore:
Timestamp:
11/26/2006 02:09:44 PM (2 years ago)
Author:
xue
Message:

Fixed the bug that TPager would not display if it was invisible previously

Location:
branches/3.0
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/3.0/HISTORY

    r1512 r1515  
    55BUG: TTableCell should render   only when Text is not set and there's no child (Qiang) 
    66BUG: global state was not saved when redirect() is invoked (Qiang) 
     7BUG: TPager would not display if it was invisible previously (Qiang) 
    78ENH: Ticket#446 - Added TMetaTagCollection.getMetaTagByID method (Qiang) 
    89CHG: Ticket#437 - __autoload is replaced by spl_autoload_register (Qiang) 
  • branches/3.0/framework/Web/UI/WebControls/TPager.php

    r1397 r1515  
    5252        const CMD_PAGE_LAST='Last'; 
    5353 
     54        private $_pageCount=0; 
     55 
    5456        /** 
    5557         * Restores the pager state. 
     
    269271                        throw new TConfigurationException('pager_controltopaginate_invalid',$controlID); 
    270272 
    271                 if($targetControl->getAllowPaging() && $targetControl->getPageCount()>1) 
    272                 { 
    273                         $this->setVisible(true); 
     273                if($targetControl->getAllowPaging()) 
     274                { 
     275                        $this->_pageCount=$targetControl->getPageCount(); 
    274276                        $this->getControls()->clear(); 
    275277                        $this->setPageCount($targetControl->getPageCount()); 
     
    278280                } 
    279281                else 
    280                         $this->setVisible(false); 
     282                        $this->_pageCount=0; 
     283        } 
     284 
     285        /** 
     286         * Renders the control. 
     287         * The method overrides the parent implementation by rendering 
     288         * the pager only when there are two or more pages. 
     289         * @param THtmlWriter the writer 
     290         */ 
     291        public function render($writer) 
     292        { 
     293                if($this->_pageCount>1) 
     294                        parent::render($writer); 
    281295        } 
    282296