[TYPO3-mvc] Model object tree building with Tx_Extbase_Persistence_ObjectStorage property

Claus Fassing claus at fassing.eu
Sun Sep 26 16:39:48 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 25.09.2010 21:47, schrieb Claus Fassing:
> I get in trouble with a Tx_Extbase_Persistence_ObjectStorage defined
> field as follow
> 
> Entry (root object)
>  title (string)
>  company (Company object)
>  [...]
> 
> Company
>  name (string)
>  contact (Tx_Extbase_Persistence_ObjectStorage of Person object)
>  [...]
> 
> Person
>  forename (string)
>  lastname (string)
>  [...]
> 
> <f:form method="post" action="create" name="entry" object="{entry}">
>   <f:form.textbox property="company.name" id="companyname" />
> 	<f:form.textbox property="company.contact.forename" id="forename"/>
> 	<f:form.textbox property="company.contact.lastname" id="lastname"/>
> </f:form>
> 
> I can write on the field name of company object (company object will
> created),
> but writing on forename or lastname always failed with
> #1251814355: transformToObject() accepts only numeric values and arrays.
> 
> Then I try to create Person in the action and add it.
> $contact = t3lib_div::makeInstance('Tx_Myext_Domain_Model_Person');
> $entry->getCompany()->addContact($contact);
> $this->view->assign('entry', $entry);
> 
> But I get the same error message.
> 
> Are there any restrictions with Tx_Extbase_Persistence_ObjectStorage in
> the domain model and forms ?
> 
> Regards Claus

I can avoid the exception by using company.contact.0.forename for
property, but this break the value recovery after redirect / forward
from validator. Do anybody know why only these field values not get
recovered  ?

Regards Claus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMn1s0AAoJELsIv+audObfpYkH/12p3vDuVsvXKwu7Rr7itEn9
NRa+Bqb2vDzJRZiQUy9G45wl+oerU6SnxjSzpwBHy+rynAUZJphSc4tFbOX6R1Mg
2sUjI0ap6PatT37gZbybirSi1/jWPCY7+Vm/eDcQ2OjFNtwPE5z5DUS5NYm73NNZ
HxBG6UIozz/ERKf1aNN893YKmzxP9sEoqzEghjhwx1nczppVMSEWvahjmlopPqGj
wIyHglh0Q+ktNnXe87b3F39TcBIbP8YhBPZcs2zUo9dFgFJR8x6qy4UlRo4DnD1b
p7O8La4UJ9SowppQ4Y006/LFNR0pyNiQGOl5RxYGvrEHP0mxu3yfjQgHaQ1bJ9Q=
=vrwH
-----END PGP SIGNATURE-----


More information about the TYPO3-project-typo3v4mvc mailing list