[Flow] checked checkboxes from model property
Damiano Faccioli
damiano.faccioli at posit.it
Mon May 25 16:59:42 CEST 2015
Hi Nicola,
I'm using checkbox but my case is not exactly as your: I haven't m2m
relation; but I think it can work for you also.
In my new.html template the snippet is:
<f:for each="{tripTypes}" as="type" key="key" iteration="itemIteration">
<label class="radio-inline"><f:form.radio property="roundTrip"
id="type{key}" value="{key}"
checked="{itemIteration.isFirst}"/>{type}</label></f:for>
as you can see I've forced the default checked; in the same way I've forced
the checked element in the edit form as you can see below in the snippet:
<f:for each="{tripTypes}" as="type" key="key" iteration="itemIteration">
<label class="radio-inline"><f:form.radio property="roundTrip"
id="type{key}" value="{key}"
checked="{expense.roundTrip->f:format.number(decimals:0)}==
{key}"/>{type}</label>
</f:for>
In my code the Item collection is tripTypes, in checked condition you can
use any property of the current iteration item.
I hope this can help you, if you post some snippet I can help you.
D.
--
Damiano Faccioli
Posit sc
via Guardini, 58 - 38121 Trento
website: www.posit.it
Telefono: 0461 822068
e-mail: damiano.faccioli@ <damiano.faccioli at gmail.com>posit.it
<damiano.faccioli at posit.it>
Skype: rifaccio
More information about the Flow
mailing list