[TYPO3-mvc] using 1 form for multiple objects

Alex Bailey vile at planet-generals.de
Mon May 10 10:12:35 CEST 2010


Am 5/10/10 7:52 AM, schrieb Steffen Ritter:
> Yes there is: a workaround: You may create a dummy object with just one
> property: several of your other objects. Put this object into the form,
> you will just submit "one" but may have as much timetable entries as you
> want.

Thanks for your tip I get the idea, but I don't know how to implement it 
properly. I've created a model "timetackinglist" with 1 property

/**
      * entrys
      *
      * @var 
Tx_Extbase_Persistence_ObjectStorage<Tx_SmediaTimetracker_Domain_Model_Timetracking>
      */
     protected $timetracks;

  public function __construct() {
         $this->timetracks = new Tx_Extbase_Persistence_ObjectStorage();
     }


/**
      *
      * @param Tx_SmediaTimetracker_Domain_Model_Timetracking $timetrack
      * @return void
      */
     public function 
addJob(Tx_SmediaTimetracker_Domain_Model_Timetracking $timetrack) {
         $this->timetracks->attach($timetrack);
     }

But I don't really know how I can tell the form to add all the entrys to 
this object when I send it. Do I have to wrap each entry in my form with 
another element to classify it as an object?

Regards

Alex



More information about the TYPO3-project-typo3v4mvc mailing list