[TYPO3-mvc] Working with Tx_Extbase_Persistence_ObjectStorage
Franz Koch
typo3.RemoveForMessage at elements-net.de
Mon Aug 8 12:55:50 CEST 2011
Hi Gernot,
...
>> public function newAction(Tx_MyExt_Domain_Model_FrontendUser $newUser
> = null) {
>> if ($newUser === null) {
>> $newUser =
> t3lib_div::makeInstance('Tx_MyExt_Domain_Model_FrontendUser');
>> }
as of Extbase 1.3 you should use $this->objectManager->create('Tx....')
instead of t3lib_div::makeInsance (also for the repository etc). So if
you use Extbase 1.3 or later, please adopt those lines.
> Template:
>> <f:form action="create" controller="User" name="newUser"
> object="{newUser}" method="post">
>> [...]
>> <f:form.select name="usergroup" property="usergroup"
> options="{usergroupArray}" optionValueField="uid"
> optionLabelField="title" />
>> [...]
>> </f:form>
if you set the "property" attribute, don't set the "name" attribute, it
will be created automatically for you. I suppose that's the issue in
your case (the custom field name might not belong to the field array of
your user object and is thus not mapped to the object). In doubt, check
the resulting html code and see if your usergroup property is part of
your user object namespace, like the other fields.
--
kind regards,
Franz Koch
More information about the TYPO3-project-typo3v4mvc
mailing list