[TYPO3-mvc] How to build create/new forms correctly - blogexample has issues - throwing exceptions with checkboxes/radio buttons
Franz Koch
typo3.RemoveForMessage at elements-net.de
Mon Feb 22 15:55:51 CET 2010
Hi,
I'm trying to build my first mail form with extbase/fluid. Therefor I
created a model holding all form fields as properties, some of them are
used as radio buttons or checkboxes. So far so good. But as soon as I
try to render the form I get the following error:
"Uncaught exception 'RuntimeException' with message 'No value found for
key "Tx_Fluid_ViewHelpers_FormViewHelper->formObject"'
in...ViewHelperVariableContainer.php"
I tracked it down to my radio and checkbox fields. As soon as I remove
the "property" attribute the form is rendering fine (except of the
missing name attributes etc).
I tracked it even further down, that this issues is related to a not
existing instance of my model. As soon as I create a empty object from
my model and pass it to the view, checkboxes and radio buttons are also
working with assigned property attributes.
But according to the blog example and all other extbase extensions I had
a look at, I don't have to create a empty object by hand and can simply
pass NULL to the view:
public function newAction(Tx_BlogExample_Domain_Model_Blog $newBlog =
NULL) {
$this->view->assign('newBlog', $newBlog);
}
But if I do that, I again get exeptions from FLUID. So how to do it
correctly? Is it simply a bug in the FLUID viewHelpers not checking for
the existence of objects or is there something else wrong? Or do I miss
some configuration options?
--
kind regards,
Franz Koch
More information about the TYPO3-project-typo3v4mvc
mailing list