Guest User

Untitled

a guest
Sep 19th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. ### THE FORM #######
  2. <f:flashMessages class="flashmessages" />
  3.  
  4. <f:form action="create" object="{student}" name="newStudent">
  5.  
  6. <f:render partial="FormErrors" arguments="{objectName: objectName}" />
  7. <f:render partial="PropertyErrors" arguments="{objectName: objectName, property: name}" />
  8.  
  9. <ol>
  10. <li>
  11. <label for="firstname">Vorname</label>
  12. <f:form.textfield property="name.firstName" id="firstName" />
  13. </li>
  14.  
  15. <li>
  16. <label for="lastname">Nachname</label>
  17. <f:form.textfield property="name.lastName" id="lastName" />
  18. </li>
  19.  
  20. <li><label for="matrikelnumber">Matrikelnumber[0-9]\{7\}</label>
  21. <f:form.textfield property="matrikel" id="matrikel" />
  22. </li>
  23.  
  24. <li><label for="group">Gruppe [1-6]</label>
  25. <f:form.textfield property="groupid" id="groupid" />
  26. </li>
  27.  
  28. <li><f:form.submit value="Create" />
  29. </li>
  30. </ol>
  31. </f:form>
  32.  
  33. ### END FORM ###
  34.  
  35. ### PROPERTY ERROR PARTIAL ###
  36.  
  37. <f:form.validationResults for="{objectName}">
  38. <f:if condition="{validationResults.flattenedErrors}">
  39. <p class="error">
  40. <f:for each="{validationResults.flattenedErrors}" key="propertyPath"
  41. as="errors">
  42. <f:if condition="{propertyPath}">
  43. <strong>{propertyPath}:</strong>
  44. </f:if>
  45. <f:for each="{errors}" as="error">{error.code} : {error} <br /></f:for>
  46. </f:for>
  47. </p>
  48. </f:if>
  49. </f:form.validationResults>
  50.  
  51. ### END PARTIALS ###
  52.  
  53. ### FORM ERROR PARTIALS ###
  54.  
  55. <f:form.validationResults for="{objectName}">
  56. <f:if condition="{validationResults.flattenedErrors}">
  57. <div class="b-message error">
  58. <h4>Errors occurred</h4>
  59. <p>Please check the highlighted fields below!</p>
  60. </div>
  61. </f:if>
  62. </f:form.validationResults>
  63.  
  64. ### END PARTIALS ###
  65.  
  66. ### GENERATED HTML ###
  67.  
  68. <div class="b-message error">
  69. <h4>Errors occurred</h4>
  70. <p>Please check the highlighted fields below!</p>
  71. </div>
  72.  
  73. <p class="error">
  74. <strong>newStudent.matrikel:</strong>
  75. 1221565130 : The given subject did not match the pattern. Got: 0 <br />
  76.  
  77. <strong>newStudent.groupid:</strong>
  78. 1221565130 : The given subject did not match the pattern. Got: 0 <br />
  79.  
  80. <strong>newStudent.name:</strong>
  81. 1268676765 : The person name cannot be empty. <br />
  82. </p>
  83.  
  84. <ol>
  85. <li>
  86. <label for="firstname">Vorname</label>
  87. <input id="firstName" type="text" name="newStudent[name][firstName]" value="" />
  88. </li>
  89.  
  90. <li>
  91. <label for="lastname">Nachname</label>
  92. <input id="lastName" type="text" name="newStudent[name][lastName]" value="" />
  93. </li>
  94.  
  95. <li>
  96. <label for="matrikelnumber">Matrikelnumber [0-9]\{7\}</label>
  97. <input id="matrikel" type="text" name="newStudent[matrikel]" value="" class="f3-form-error" />
  98. </li>
  99.  
  100. <li>
  101. <label for="group">Gruppe [1-6]</label>
  102. <input id="groupid" type="text" name="newStudent[groupid]" value="" class="f3-form-error" />
  103. </li>
  104.  
  105. <li>
  106. <input type="submit" name="" value="Create" />
  107. </li>
  108. </ol>
  109.  
  110. ### END HTML ###
Advertisement
Add Comment
Please, Sign In to add comment