Announcement Announcement Module
No announcement yet.
Pre binding fields on a command object Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pre binding fields on a command object

    I'm using a SimpleFormController. I use the same form to edit or create a new hibernate command object that's saved to the database afterwards.

    One field should be immediatly set when the form is loaded. I pass the parameter through the request. This works when I use setBindOnNewForm(true). But there are some required fields, and the form gives an error because it's binded.

    Is there a way to automaticly set some properties on a command object without really posting the form?

  • #2
    Well, it turns out this can be easily achieved with this code in formBackingObject():

    if (!isFormSubmission(request)) {
    bindAndValidate(request, command);