[TYPO3-mvc] extbase Validation / Messaging

Lucas Thurston lucas at castironcoding.com
Fri Mar 5 16:11:06 CET 2010


Hi everyone,
I'm a few days away from launching my first extbase plugin and was 
hoping I could find some help or direction for a few lingering issues 
that are starting to eat up more and more time. They all seem to revolve 
around a form.

The thing that I've been struggling most with is replace the property 
name in the validation error messages. How do I make:

lastName: The length of the given string was not between 1 and 80 
characters.

become:

Last Name: The length of the given string was not between 1 and 80 
characters.

without some ugly control logic flag setting for each field with an 
error on it?  I've resorted to trying several hacky solutions to get 
this work (tried using <f:alias> to no avail, <f:if 
condition="{error.propertyName} == 'something'">, a few other things, 
you get the picture) so I'm anxious for the right solution.

In the same form I need to validate an email field only if there's a 
value in another field when the form is submitted (in other words if the 
field "name" has a value, then validate field "email" as an email 
address, otherwise don't). So I don't think I can set the validation in 
the field notation because the email validation does not accept empty 
strings. How do I conditionally validate properties on a object?

Is there a built-in way to avoid duplicate form submission?

If there is a resource out there that I might have missed in my search 
to answers for these questions please just let me know.

thanks,
Lucas


More information about the TYPO3-project-typo3v4mvc mailing list