Example #1
0
 /**
  * This method will be called when the component (or component's parent)
  * becomes attached to a monitored object. Do not call this method yourself.
  * @param  IComponent
  * @return void
  */
 protected function attached($presenter)
 {
     if ($presenter instanceof Presenter) {
         $this->setAction(new Link($presenter, $this->lookupPath('Nette\\Application\\Presenter') . self::NAME_SEPARATOR . 'submit!', array()));
         // fill-in the form with HTTP data
         if ($this->isSubmitted()) {
             foreach ($this->getControls() as $control) {
                 $control->loadHttpData();
             }
         }
     }
     parent::attached($presenter);
 }
 /**
  * This method will be called when the component (or component's parent)
  * becomes attached to a monitored object. Do not call this method yourself.
  * @param  IComponent
  * @return void
  */
 protected function attached($presenter)
 {
     if ($presenter instanceof Presenter) {
         $name = $this->lookupPath('Presenter');
         if (!isset($this->getElementPrototype()->id)) {
             $this->getElementPrototype()->id = 'frm-' . $name;
         }
         $this->setAction(new Link($presenter, $name . self::NAME_SEPARATOR . 'submit!', array()));
         // fill-in the form with HTTP data
         if ($this->isSubmitted()) {
             foreach ($this->getControls() as $control) {
                 $control->loadHttpData();
             }
         }
     }
     parent::attached($presenter);
 }