Announcement Announcement Module
Collapse
No announcement yet.
onSubmit does not get invoked on my controller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • onSubmit does not get invoked on my controller

    The form loads with all the appropriate values but when I click on the submit button the formBackingObject gets invoked again and the onSubmit doesn't get invoked???

    Here's my bean def:

    <bean id="tranDefGroupDetailController" class="com.x.web.controllers.TranDefGroupDetailCon troller">
    <property name="commandName">
    <value>tranDefGroup</value>
    </property>
    <property name="formView">
    <value>tranDefGroupDetail</value>
    </property>
    <property name="successView">
    <value>tranDefGroupList</value>
    </property>
    </bean>

    Here's code snippet from my controller which extends SimpleFormController

    protected Object formBackingObject(HttpServletRequest request) throws Exception
    {
    long id = RequestUtils.getRequiredLongParameter(request, "tranDefGroupId");
    TranDefGroup tranDefGroup = ConfigurationService.getTranDefGroup(new Long(id));
    return tranDefGroup;
    }

    protected ModelAndView onSubmit(Object command) throws Exception
    {

    TranDefGroup tranDefGroup = (TranDefGroup)command;
    boolean result = ConfigurationService.save(tranDefGroup);
    if(result)
    return new ModelAndView(getSuccessView());
    else
    return new ModelAndView(getFormView());
    }

  • #2
    Nevermind. I had not added a method="post" to my form tag.

    Comment

    Working...
    X