Skip to content

Instantly share code, notes, and snippets.

@helhum
Created October 21, 2014 15:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helhum/884928ba589f5e28e6b7 to your computer and use it in GitHub Desktop.
Save helhum/884928ba589f5e28e6b7 to your computer and use it in GitHub Desktop.
Ordered validation results
<f:form.validationResults for="{propertyPath}">
<f:if condition="{validationResults.flattenedErrors}">
<ul>
<f:for each="{validationResults.flattenedErrors}" as="errors">
<li>
<ul>
<f:for each="{errors}" as="error"><li>{error}</li></f:for>
</ul>
</li>
</f:for></ul>
</f:if>
</f:form.validationResults>
Description:
<f:render partial="FormErrors" arguments="{propertyPath: 'newExample.description'}"/>
Title:
<f:render partial="FormErrors" arguments="{propertyPath: 'newExample.title'}"/>
<f:form action="create" enctype="multipart/form-data" name="newExample" object="{newExample}">
<label for="title">Title:</label><f:form.textfield property="title" />
<label for="description">Description:</label><f:form.textfield property="description" />
<f:form.submit value="Create new" />
</f:form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment