Meanwhile, I received an answer from Composite (btw, tnx!):
Not an easy fix, since we put all the validation logic into the fields :/
On the bright side the code its fairly open and you can address it by extending the way we handle submits.
One way - if you are building up the form markup (the f:function /> call to the Composite.Forms.FormBuilder.Form function) yourself and not using the visual tool – is to specify a FailureMessage parameter. This is an xhtml document which will be shown if a handler throws an exception.
You can test this by editing a function call and add the parameter below to it and then have a handler throw an exception.
<f:param name="FailureMessage">
The problem with this approach is that the error feedback to the user is static, so you would not be able to communicate details about the error.
Another way is to edit the ~/App_Data/Razor/Composite/Forms/FormBuilder/Form.cshtml file and modify the code at the end (the Submit function) – if you let you handler store error messages in a http context variable you can check for such a value in the Submit function and override what gets shown to the user.
Neither way is optimal and we’ll look into making this nicer in a coming release.
Not an easy fix, since we put all the validation logic into the fields :/
On the bright side the code its fairly open and you can address it by extending the way we handle submits.
One way - if you are building up the form markup (the f:function /> call to the Composite.Forms.FormBuilder.Form function) yourself and not using the visual tool – is to specify a FailureMessage parameter. This is an xhtml document which will be shown if a handler throws an exception.
You can test this by editing a function call and add the parameter below to it and then have a handler throw an exception.
<f:param name="FailureMessage">
<html>
<head />
<body>
<p>ZOMG stuff broke :(</p>
</body>
</html>
</f:param>The problem with this approach is that the error feedback to the user is static, so you would not be able to communicate details about the error.
Another way is to edit the ~/App_Data/Razor/Composite/Forms/FormBuilder/Form.cshtml file and modify the code at the end (the Submit function) – if you let you handler store error messages in a http context variable you can check for such a value in the Submit function and override what gets shown to the user.
Neither way is optimal and we’ll look into making this nicer in a coming release.