Jump to content

aniketto

New Members
  • Posts

    3
  • Joined

  • Last visited

aniketto's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Actually in updateAction $form is empty value which creates all problems. I got following errors when debugged. Debug Strict (PHP 5): /mobile_mail/application/admin/controllers/MaillistController.php line 304 - Creating default object from empty value Debug Strict (PHP 5): /mobile_mail/application/admin/controllers/MaillistController.php line 312 - Creating default object from empty value Debug Error: /mobile_mail/application/admin/controllers/MaillistController.php line 313 - Call to undefined method stdClass::save() So can anyone tell how to retain the form element values among actions. Thanks, Aniketto
  2. In below code detailAction() is called using _forward() from some other action wiith id parameter set. delivery info id field is a hidden field. My prblem is in updateAction the delivery info id field is null so all succeeding code fails. How to retain its value? public function detailAction() { $mailDelivery = new MailDelivery(); $criteria = array(); $this->getFrontController()->setParam('noViewRenderer', TRUE); $view = $this->getView(); $form = $this->getForm('detail'); $form->setAction('update'); $view->form = $form; $request = $this->getRequest(); $criteria['id'] = $request->getParam('id'); $mailDataArray = $mailDelivery->findDetailMailData($criteria); $view->detail = $mailDataArray; //hidden delivery info id field $form->delivery_info_id->setValue($criteria['id'] ); $res = $this->getResponse(); $res->appendBody($view->render('maillist/detail.phtml')); } public function updateAction() { if ($_SERVER['REQUEST_METHOD'] != 'POST') { return; } $form = $this->getForm('detail'); $this->view->form = $form; $view->form = $form; $criteria = array(); $criteria['id'] = $form->delivery_info_id->getValue(); $criteria['browse_limit_date'] = $form->browse_limit_date->getValue(); $mailDelivery = new MailDelivery(); $rowset = $mailDelivery->find($criteria['id']); $row = $rowset->current(); $row->browse_limit_date = $criteria['browse_limit_date']; $row->save(); }
  3. aniketto

    Zend framework

    Hi all, I am new be in zend frameworl, so I need your help. In my application I display a student list on a list.phtml form. If user selects radio button in front of student name and presses 'Detail' button, the request is forwarded(_forward) to detailAction(). While forwarding I pass student_id as a parameter. In detailAction detail.phtml displays student details and stores student_id is as a hidden parameter. In detail action I also set action as updateAction(). Now in detail.phtml form student Birthdate is editable text box. So if user presses update button birthdate should be updated. On update button update action gets called but as I do getform, new form is created and I can not retrieve the hidden field student_id field. So I cant do the update. can anybody suggest how to solve this problem. In updateAction() how can I get the form values which were stored in detailAction(). In short I am trying to do two things in same action. If control is reached by _forward() use parameter in request to acquire database data and display . Else if control is reached by pressing update button update birthday value and display form. Is it possible to do this?
×
×
  • Create New...