[TYPO3-mvc] Problems on double use of a object in two different objectStorage

Manfred Rutschmann manfred.rutschmann at revier.de
Mon Sep 20 10:30:50 CEST 2010


Am Mon, 20 Sep 2010 09:49:44 +0200 schrieb Franz Koch:

> as long as you don't need persistence for your stations/objects, you 
> should always clone them in order to cut the connection to the 
> persistence layer - otherwise changes made to these objects will 
> automatically be stored in the DB (as long as the modified properties 
> relate to TCA columns). While this might work for you now, the way you 
> deal with the form seems in general wrong to me from an OOP point of view.
> 
> You have to render a form - right? Then you might need a formObject 
> that's reflecting the possible formFields and also takes care of 
> validation by setting according annotations for it's properties.
> You pass this formObject to the Fluid formViewHelper and assign the 
> according properties to your formFields. Extbase is doing all the magic 
> of mapping the values of the form fields to the formObject automatically 
> then. It also does automatically know which station is selected, as this 
> is stored inside the formObject and does not have to be stored in the 
> stationObject.
> You could also store the form values inside a custom array instead of a 
> object and use it's values to see which fields are selected - this 
> should work too up to a certain degree. But using a object is the 
> recommended way in your case I think.
> 
> If you need multiStepForms, there are some solutions/concepts available 
> on this list.

Hi Franz,

thank you for your answer and aspects of the form object. The most parts of
the form elements are loading with ajax in relations of the selected one. I
have to use some optgroups for visual splitting too. So the most fields are
generated outside the form object and would be transmitted in json stlye.I
dont think that this is possible with the framework?!
Another positive aspect for me is that this form is only for select some
properties of a search. No values from that are permitted to store in the
database. For a form where we have some userinputs like a userprofile or
something i feel with you.

Regards Manne


More information about the TYPO3-project-typo3v4mvc mailing list