Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor omission from beaneditform example

...

Code Block
languagexml
    <t:beaneditform submitlabel="Create Address" object="address"
        reorder="honorific,firstName,lastName,street1,street2,city,state,zip,email,phone"/>

The default for the submitlabel parameter is "Create/Update", but here we're overriding that default to a specific value.

...

Warning

You can easily get confused when you make a change to an entity class, such as adding the @Validate annotatationannotation, and not see the result in the browser. Only component classes, and (most) classes in the Tapestry services layer, are live-reloaded. Data and entity objects are not reloaded, so this is one area where you need to stop and restart Jetty to see the change.

Restart the application, and refresh your browser, then hit the submit Create Address button.

Image Modified

Form with client side validations visible

This is a shot just after hitting the submit Create Address button; all the fields have been validated and pop-up error bubbles are displayed. This looks a bit cluttered, but all the bubbles, except for the one for the focus field (the field the user is actively typing into), will fade out after a moment. As you tab from field to field, Tapestry will validate your input and briefly display the error bubble. And all of this is taking place on the client side, without any communication with the application.Each field in error has been highlighted (it's a bit subtle) and marked with a red "errors displayed. Each field in error has been highlighted in red and marked with a red "X". Further, the label for each of the fields has also been highlighted in red, to even more clearly identify what's in error. The cursor has also been moved to the first field that's in error. And all of this is taking place on the client side, without any communication with the application.

Once all the errors are corrected, and the form does submit, all validations are performed on the server side as well (just in case the client has JavaScript disabled).

...