Announcement Announcement Module
Collapse
No announcement yet.
user's changes in the back-and-resubmit in portlet Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • user's changes in the back-and-resubmit in portlet

    Hi All,

    Thanks for giving the platform to share the problem. Really new forum and spring.

    I have a problem in the broswer back button resubmit the form. It is not taking the user changes. I was going through lots of information on the internet but not able to find any information about portlet related information.

    setBindOnNewForm is set to true.it seem like if user use browser back button it is not calling handleActionRequestInternal so that it not able to set the new parameter in the handleInvalidSubmit method.

    Please help me to resolve this problem.

    public class TestController extends AbstractWizardFormController
    {
    /*
    * Returns a ModelAndView object when the page is rendered
    *
    * @param request
    * the Render Request
    * @param response
    * the Render Response
    * @return the page to render
    * @throws Exception
    */

    // initialize the form from the formBackingObject
    public TestController() {
    super();
    setBindOnNewForm(true);
    }

    protected void handleActionRequestInternal(ActionRequest request, ActionResponse response)
    throws Exception
    {
    System.out.println("Hello123");
    super.handleActionRequestInternal(request, response);
    }

    protected ModelAndView handleRenderRequestInternal(RenderRequest request,
    RenderResponse response) throws Exception
    {
    if (logger.isDebugEnabled())
    {
    logger.debug("handleRenderRequestInternal(RenderRe quest, RenderResponse) - start");
    }
    System.out.println("handleRenderRequestInternal ::");
    request.getParameter("");
    ModelAndView returnModelAndView = super.handleRenderRequestInternal(request, response);
    //bindPageURL(request, response, returnModelAndView);

    if (logger.isDebugEnabled())
    {
    logger.debug("handleRenderRequestInternal(RenderRe quest, RenderResponse) - end");
    }
    return returnModelAndView;
    }
    /**
    * Logger for this class
    */
    private static final Logger logger = Logger.getLogger(AlcoholismController.class);

    /*
    * Returns an Object when the page is loaded first time
    *
    * It will initiate the Object
    *
    * @param request
    * the PortletRequest
    * @return the Object to be loaded first time
    * @throws Exception
    */
    protected Object formBackingObject(PortletRequest request) throws Exception
    {
    if (logger.isDebugEnabled())
    {
    logger.debug("formBackingObject(PortletRequest) - start");
    }

    System.out.println("formBackingObject");
    TestSection testSection = new TestSection();


    if (logger.isDebugEnabled())
    {
    logger.debug("formBackingObject(PortletRequest) - end");
    }
    return testSection;
    }
    /*
    protected boolean isFormSubmission(PortletRequest request)
    {

    System.out.println("Inside of isFormSubmission");
    for (Enumeration params = request.getParameterNames(); params.hasMoreElements()
    {
    String paramName = (String) params.nextElement();
    System.out.println("paramName :: " + paramName);
    if(paramName != null && (paramName.startsWith(PARAM_TARGET) ||
    paramName.equals(PARAM_FINISH) || paramName.equals(PARAM_CANCEL)))
    {
    return true;
    }
    }
    //return true;
    return super.isFormSubmission(request);
    }*/

    /*
    protected void onBindOnNewForm(HttpServletRequest request, Object command, BindException errors)
    throws Exception {
    System.out.println("onBindOnNewForm ..............");
    super.onBindOnNewForm(request, command, errors);
    }*/

    }
Working...
X