Bug #4667

Error class magic only works for object properties....

Added by Nikolas Hagelstein about 12 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
ViewHelpers
Target version:
-
Start date:
2009-09-17
Due date:
% Done:

0%

Estimated time:
Has patch:

Description

Like:

<f:form.textbox property="whatever" errorClass="iFail" />

Should work for:
<f:form.textbox name="whatever" errorClass="iFail" />

as well.

#1

Updated by Bastian Waidelich about 12 years ago

  • Project changed from 534 to TYPO3.Fluid
  • Category deleted (432)
#2

Updated by Bastian Waidelich about 12 years ago

  • Category set to ViewHelpers
  • Status changed from New to Needs Feedback
  • Branch set to v4 + v5

But how should the error handling work, if the textbox was not bound to a property?

#3

Updated by Nikolas Hagelstein about 12 years ago

Bastian Waidelich wrote:

But how should the error handling work, if the textbox was not bound to a property?

yes but it has a name and it's bound to the namespaced form so it could be assigned to
appropriate property within the error object.

#4

Updated by Bastian Waidelich about 12 years ago

Nikolas Hagelstein (pulponair) wrote:

yes but it has a name and it's bound to the namespaced form so it could be assigned to
appropriate property within the error object.

Ok, but why wouldn't you just bind it to the property in that case?

#5

Updated by Nikolas Hagelstein about 12 years ago

Bastian Waidelich wrote:

Nikolas Hagelstein (pulponair) wrote:

yes but it has a name and it's bound to the namespaced form so it could be assigned to
appropriate property within the error object.

Ok, but why wouldn't you just bind it to the property in that case?

A property would presume an object. Many real world forms do not reference to an object or they consist of a mixture of object fields and addtional fields.
Sample:

<f:form controller="AnyController" action="index" object="{user}" name="user" id="userForm">
  <f:form.textbox property="username" />
  <f:form.textbox property="password" />
  <f:form.textbox name="passwordConfirmation" />
</form>

In this case username and password refere to an object (domain model user).
But passwordConfirmation das not belong to this object at all but needs to be validated as well.

Imagine forms that do not to refere to an object at all. E.g. if the form data contains various Information and real objects are created from this information after the form has been submited succesfully.

#6

Updated by Bastian Waidelich about 12 years ago

  • Assignee set to Sebastian Kurfuerst

Nikolas Hagelstein (pulponair) wrote:

A property would presume an object.

Ok, I see. But AFAIK the property validation only works for bound objects yet. I'm assigning this to Sebastian for now.

Thanks for your feedback!
Bastian

#7

Updated by Nikolas Hagelstein about 12 years ago

Bastian Waidelich wrote:

Ok, I see. But AFAIK the property validation only works for bound objects yet. I'm assigning this to Sebastian for now.

Nope works for controller arguments as well:

@validate $forename notEmpty
public function indexAction($forename.....

#8

Updated by Sebastian Kurfuerst over 11 years ago

  • Assignee deleted (Sebastian Kurfuerst)
#9

Updated by Sebastian Kurfuerst over 10 years ago

  • Status changed from Needs Feedback to Resolved

works now with the new Validation.

Also available in: Atom PDF