[symfony-users] Re: One module, many forms

2009-03-18 Thread Lawrence Krubner



On Mar 17, 7:23 pm, Tomasz Ignatiuk tomek.ignat...@gmail.com wrote:
 Hi

 I have a module called Documents. In this modul I use few kinds of
 documents. They use the same table in db but different fields. So that
 I created few Forms for them.

 I overridden executeNew() in order to call proper form class. And it
 works well. Proper form object is created, template displayed,
 document saved.

 I overridden executeEdit() in order to call proper form class. And it
 works well. Proper form object is created, template displayed with
 data. But after saving Symfony still uses the DocumentForm class
 instead of for example DocumentMyVerForm class. I overriden
 executeUpdate action in order to use proper form class but it still
 uses main DocumentForm. Any ideas how to set it up?

Can we see what the code is for your update method? Are you sure you
are explicitly calling your new child class in the update method?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: One module, many forms

2009-03-18 Thread Tomasz Ignatiuk

  public function executeUpdate(sfWebRequest $request)
  {
$this-document = $this-getRoute()-getObject();
$this-wystawca = PartnerPeer::getPartnerByLogo($this-document-
getLogoPartneraSprzedajacy());
$this-termin_platnosci = $this-wystawca-getTerminPlatnosci();
switch ($this-document-getDocumentTypy()-getLogo())
{
   case FV:
$this-form = new DocumentEdycjaFvForm($this-document);
$this-document_type = FV;
$this-stawkivat = StawkiVatPeer::doSelect(new Criteria());
   break;
   case FI:
$this-form = new DocumentEdycjaFvForm($this-document);
$this-document_type = FI;
$this-stawkivat = StawkiVatPeer::doSelect(new Criteria());
   break;
   case FZ:
$this-form = new DocumentEdycjaFzForm($this-document);
$this-document_type = FZ;
$this-stawkivat = StawkiVatPeer::doSelect(new Criteria());
   break;
   case RUD:
$this-form = new DocumentEdycjaRudForm($this-document);
$this-document_type = RUD;
   break;
   case RUDA:
$this-form = new DocumentEdycjaRudForm($this-document);
$this-document_type = RUDA;
   break;
}

$this-processForm($request, $this-form);

$this-setTemplate('dane');
  }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: One module, many forms

2009-03-18 Thread Tomasz Ignatiuk

Any guess?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---