[TYPO3-mvc] How to send Tx_Extbase_Persistence_ObjectStorage to a Controller action?

Simon Schaufelberger schaufelREMOVE-MEberger at punkt.de
Tue Feb 8 11:28:04 CET 2011


Hi,
i have a list of objects and i want to select some with a checkbox to 
edit those entries in another view.

How do I need to format my template and my action so that i can handle that?

what i have is the following as a starting point:

<f:form method="post" controller="Project" action="edit" name="project">
<input type="checkbox" value="1" name="tx_myextension_pi1[projects]">
<input type="checkbox" value="2" name="tx_myextension_pi1[projects]">
<input type="checkbox" value="3" name="tx_myextension_pi1[projects]">
<input type="checkbox" value="4" name="tx_myextension_pi1[projects]">
<input type="checkbox" value="5" name="tx_myextension_pi1[projects]">
</f:form>

<input type="checkbox" value="5" name="tx_myextension_pi1[projects][]">

also doesn't help.

and in my controller:

/**
  * Updates some projects
  *
  * @param 
Tx_Extbase_Persistence_ObjectStorage<Tx_Myextension_Domain_Model_Project> $projects
  * @dontvalidate $projects
  * @dontverifyrequesthash
  */
public function editAction(Tx_Extbase_Persistence_ObjectStorage $projects) {
	
	echo "<pre>";
	print_r($projects);
	echo "</pre>";
	exit;
}

At the moment i get Extbase Exceptions like
#1251730701: The value was a simple type, so we could not map it to an 
object. Maybe the @entity or @valueobject annotations are missing?

I can understand that since i don't have an object which is called 
"projects" but i don't want to send a single but multiple objects.
-- 
Kind regards,

Schaufi from punkt.de


More information about the TYPO3-project-typo3v4mvc mailing list