Announcement Announcement Module
Collapse
No announcement yet.
SimpleFormController and populating values Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SimpleFormController and populating values

    I've a jsp page which is configured as FormView of a SimpleFormController. IN the jsp, i have a drop down box of which the values are coming from database. Now my question is how to populate the drop down box?

    Using simpleformcontroller, i'm unable to achieve what i mentioned above.

    Thank you so much for any help. I really appreciate it.

  • #2
    Just implement the referenceData method and set the drop down values there. Check also the Spring form tags reference http://static.springframework.org/sp...-form.tld.html. Study the select and options part.

    Code:
    protected Map referenceData(HttpServletRequest request, Object command,
    			Errors errors) throws Exception {
    
        	Map referenceData = new HashMap();
            List yourList = new ArrayList();
            // populate yourList choices here...
            referenceData.put("", yourList);
            return referenceData;
    There are 100+ questions and answers regardinding how to use the select/options tags. Please read the older posts aswell.

    Comment


    • #3
      Thanks Noon.

      I could able to implement the referenceData and able to populate the drop down values using just one SimpleFormController.

      I used the following thread as the reference for implementing my logic.

      http://forum.springframework.org/showthread.php?t=60965

      Thanks again.

      Comment

      Working...
      X