[TYPO3-mvc] FLUID: check checkbox by array

Daniel Lorenz mailinglists at capsicumnet.de
Fri Nov 26 07:25:51 CET 2010


Hi,

Am Freitag, den 26.11.2010, 01:53 +0100 schrieb Franz Koch:
> Hey,
> 
> > I trying to check a group of checkboxes in Fluid-template specified by
> > an two dimensional array myarr[x][y].
> >
> > The x and y are the uids of two Objects "Cols" and "Rows".
> >
> > In ExtbaseCheatSheet I found {name.number} for an array but
> > {myarr.row.uid.col.uid} doesn't work and thats OK.
> 
> what exactly do you try to do? Do you try to set the "checked" attribute 
> or do you have issues with building the correct "name" attribute?
> 
> Eitherway - this should work:
> 
> <f:for each="{mayarr}" as="row" iteration="rowIterator">
> 	<f:for each="{row}" as="col">
> 		<f:form.checkbox 
> name="nameOfObject[nameOfProperty][{rowIterator.index}][{col.uid}]" 
> checked="{col.checked}" value="TRUE" />
> 	</f:for>
> </f:for>
> 

Rows and Cols are Objects from Database Repository. I'm iterating over
these Arrays of Objects. 

Each Row and Col has an uid. These uids specify the position in the
Array, where I marked, which checkbox should be checked.

<f:for each="{rows}" as="row">
	<f:for each="{cols}" as="col">
		<f:alias map={srow: row.uid, scol: col.uid}>
			{myarr.srow.scol}
		</f:alias>
	</f:for>
</f:for>

Thanks.



More information about the TYPO3-project-typo3v4mvc mailing list