[TYPO3-mvc] repository->update generates new child records

Werner Stotter typo3 at itfix.at
Thu Feb 10 15:14:42 CET 2011


hi,

i'm writing an extension to read a csvfile and display each row in a 
table with an input field for each row to enter an amount to order. then 
a session basket is created and files with rows are stored as childs of 
this basket, all 1:n.

this just works fine, but if i want to update the basket in the frontend 
every child record is deleted and newly created in the database. the 
basket record itself is updated correctly.
also in the backend all child-records are updated and not newly created.

here is a snippet from the fluid (basket->csvfiles->headerrows only):

<f:form method="post" controller="Csvbasket" action="update" 
name="csvbasket" object="{csvbasket}">
      <f:for each="{csvbasket.csvfiles}" as="file">
	<h3>{file.tablename}</h3>
		<f:form.hidden property="csvfiles.{file.uid}.tableprefix" 
value="{file.tableprefix}" />
		<f:form.hidden property="csvfiles.{file.uid}.tablename" 
value="{file.tablename}" />
		<f:form.hidden property="csvfiles.{file.uid}.contentUid" 
value="{file.contentUid}" />
		<table class="csv-table">
			<thead>
			<f:for each="{file.headerRows}" as="headerrow">
			<f:form.hidden 
property="csvfiles.{file.uid}.headerRows.{headerrow.uid}.rowindex" 
value="{headerrow.rowindex}" />

thanks!
werner




More information about the TYPO3-project-typo3v4mvc mailing list