public function performAction(TListControl $sender, $params)
 {
     echo "Selected {$sender->getSelectedValue()} <br/>";
     switch ($sender->getSelectedValue()) {
         case 'deleted':
             $items = $this->checkList->getItems();
             foreach ($items as $item) {
                 if ($item->Selected) {
                     echo "Selected post id " . $item->Value . "<br/>";
                 }
             }
             break;
         default:
             break;
     }
 }
Beispiel #2
0
 /**
  * Registers the list control to load post data on postback.
  * This method overrides the parent implementation.
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     if ($this->getEnabled(true)) {
         $this->getPage()->registerRequiresPostData($this);
     }
 }
 /**
  * Returns the attributes to be rendered.
  * This method overrides the parent's implementation to default to 
  * adding a [] to the name
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes['name'] = $this->getUniqueID();
     if ($this->isAutoPostBack()) {
         $attributes['onchange'] = 'javascript:' . $this->getPage()->getPostBackClientEvent($this, '');
     }
     return $attributes;
 }
Beispiel #4
0
 public function addParsedObject($object)
 {
     if ($object instanceof XListMenuItem) {
         parent::addParsedObject($object);
     }
 }
Beispiel #5
0
 /**
  * Renders the control.
  * @param THtmlWriter the writer for the rendering purpose.
  */
 public function render($writer)
 {
     if ($this->getHasItems()) {
         parent::render($writer);
     }
 }
 /**
  * Registers for post data on postback.
  * This method overrides the parent implementation.
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     $this->_repeatedControl->setAutoPostBack($this->getAutoPostBack());
     $this->_repeatedControl->setCausesValidation($this->getCausesValidation());
     $this->_repeatedControl->setValidationGroup($this->getValidationGroup());
     $page = $this->getPage();
     $n = $this->getItemCount();
     for ($i = 0; $i < $n; ++$i) {
         $this->_repeatedControl->setID("c{$i}");
         $page->registerRequiresPostData($this->_repeatedControl);
     }
 }
 /**
  * Returns the attributes to be rendered.
  * This method overrides the parent's implementation to add checking
  * for rows and the multiple flag.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     if ($this->getSelectionMode() == 'Multiple') {
         $attributes['multiple'] = 'multiple';
         $attributes['name'] = $this->getUniqueID() . '[]';
     } else {
         $attributes['name'] = $this->getUniqueID();
     }
     if ($this->isAutoPostBack()) {
         $attributes['onchange'] = 'javascript:' . $this->getPage()->getPostBackClientEvent($this, '');
     }
     $attributes['size'] = $this->getRows();
     return $attributes;
 }
 /**
  * Adds attributes to renderer.
  * @param THtmlWriter the renderer
  */
 protected function addAttributesToRender($writer)
 {
     $writer->addAttribute('name', $this->getUniqueID());
     parent::addAttributesToRender($writer);
 }
 /**
  * Returns the attributes to be rendered.
  * This method overrides the parent's implementation to default to 
  * adding a [] to the name
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     if ($this->getRepeatLayout() === 'Table') {
         if (($cellSpacing = $this->getCellSpacing()) >= 0) {
             $attributes['cellspacing'] = $cellSpacing;
         } else {
             $attributes['cellspacing'] = '0';
         }
         if (($cellPadding = $this->getCellPadding()) >= 0) {
             $attributes['cellpadding'] = $cellPadding;
         } else {
             $attributes['cellpadding'] = '0';
         }
     }
     //$attributes['id']=$attributes['id'].':cblist';
     return $attributes;
 }