[TYPO3-mvc] CheckboxViewHelper -> $this->propertyValue()

Mark Kuiphuis spam at markyourweb.com
Tue Jan 31 10:26:28 CET 2012


Hi Claus,

Thanks for your reply,

On 31/01/12 6:37 PM, Claus Due wrote:
> Hi Mark,
>
>> $this->propertyValue() is always empty, whether the checkbox has been checked or not…
>
> This sounds more like
> 1) a mapping problem,

The model does have a protected $variable (of type boolean)
The table in the database (relating to the same model has this field variable (with 
datatype tinyint(1))
I don't get any errors that there is a mapping problem.

> 2) a problem in the model getters/setters,

The Model does both have a getVariable() and setVariable($variable)

> 3) a problem in TCA (missing field in showItem for example) or finally

The showItem element in the TCA array for this table does contain the variable and I 
can also see this in the TYPO3 backend when showing one of these records.

> 4) that when you are expecting to see a formObject, you may actually have a NULL value - which would make the checkbox viewhelper look for the "checked" property instead.

You lost me here :-) The visitor wants to order something from the website. They have 
to fill in the order form. They don't have an order yet, so I'm using the newAction 
for that with the @dontvalidate option.

> If you force the checked="checked" property to always be true, you will see the checkbox select itself if for some reason you are losing context with your formObject or the formObject is NULL. Otherwise I would check the other areas and then perhaps start debugging your template variables and/or variables within the checkbox viewhelper (in addition, see Fluid's AbstractFormViewHelper).

Can I assume that if values typed in textfields after submitting the form are shown 
in the form again after failing validation, that the formObject is not NULL?

> ---
> Cheers,
> Claus
> http://fedext.net



More information about the TYPO3-project-typo3v4mvc mailing list