Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: formBackingObject called twice

  1. #11
    Join Date
    Oct 2004
    Location
    Rotterdam, Netherlands
    Posts
    90

    Default

    In your controller implementation, you can override referenceData(HttpServletRequest request, int page):

    Example:

    Code:
    protected Map referenceData(HttpServletRequest request, int page) {
            Map model = new HashMap();
            model.put("locationList", Location.getValues());
             return model;
    }
    Here you could retrieve the Resource Set from your DAO.

    I am using my domain object as form backing object as well; it has an attribute
    Code:
    private Location location
    .

    Then in your JSP, you would say:

    Code:
    <spring:bind path="command.location">
    <select name="<c:out value="${status.expression}"/>">
    <c:forEach var="location" items="${locationList}">
    <option value="<c:out value="${location.code}"/>">
    <c:out value="${location.name}"/></option>
    </c:forEach>
    </select>
    </spring:bind>
    In your case, you might have to write a custom PropertyEditor for resolving the reference to the Resource Object. See: http://forum.springframework.org/sho...propertyeditor
    Last edited by robyn; May 14th, 2006 at 05:28 PM.

  2. #12
    Join Date
    Nov 2004
    Posts
    159

    Default

    Thanks a lot Delnoij. I greatly appreciate your time in providing the sample code as well.

    Great!

    Thanks very much again!

    I'll try this out and check the reference you provided as well.

  3. #13
    Join Date
    Oct 2004
    Location
    Rotterdam, Netherlands
    Posts
    90

    Default

    And study the JPetstore example ...

    Code:
    public class OrderFormController extends AbstractWizardFormController

  4. #14
    Join Date
    Nov 2004
    Posts
    159

    Default

    Sure delnoij. I'm using SimpleFormController for now. I did read about AbstractWizardFormController. I had gone through the backend code for PetClinic and JPetstore but ignored the front end code. That's how i learnt Spring. You are correct. I should take a look at the front end code now.

    Thanks again!

Similar Threads

  1. Replies: 2
    Last Post: Sep 9th, 2005, 07:33 AM
  2. Replies: 8
    Last Post: Aug 31st, 2005, 11:38 AM
  3. onSubmit not called
    By christophe in forum Web
    Replies: 4
    Last Post: Jul 29th, 2005, 05:10 PM
  4. Replies: 2
    Last Post: Jul 5th, 2005, 02:20 AM
  5. indirectly called method not intercepted
    By springtester in forum AOP
    Replies: 1
    Last Post: Sep 1st, 2004, 06:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •