Announcement Announcement Module
Collapse
No announcement yet.
Setting defaults in formBackingObject Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Setting defaults in formBackingObject

    Hello All,
    We are using Spring MVC 2.5 and I have checkboxes that are grouped in the jsp as in:
    <td>
    <label for="processedRecords">Processed Records</label>
    </td>
    <td>
    <form:checkbox path="processedRecords" value="batch" label="Batch Generated" />
    <form:checkbox path="processedRecords" value="manual" label="Manual Generated" />
    <form:checkbox path="processedRecords" value="excluded" label="Excluded" />
    </td>

    The checked values for each checkbox value I want to set are the first two as checked and the last one is unchecked. I was able to do this by adding variables: boolean batch, boolean manual, etc... to my command object, but since Spring is already handling that I thought a better way would be to pre-populate those values in the formBackingObject; however, I wasn't sure how to do it or if this was the correct practice? So, am I correct in using the formBackingObject and how do I do this?

    Thanks for the help!
    James

    Okay, this is the correct approach and I got it working. Thanks for looking.
    Last edited by jamesEston; Feb 11th, 2011, 05:22 PM. Reason: solved the issue
Working...
X