Results 1 to 2 of 2

Thread: How to handle user reload of form?

  1. #1

    Default How to handle user reload of form?

    Hello all,

    I have what I hope is a simple question here. I have a Webflow that I am using for some forms in a wizard type scenario and I have a small problem. I discovered it when I was testing one of my JSP files. I would edit the file and copy it to the server, then reload the page. What I noticed was that from the webflow's perspective it was as if I had pushed the submit button again thusly causing a new entry in the DB to be created every time. I has thought my method accounted for a scenario such as this:

    Code:
    @Override
    public Event persistFormObject(RequestContext context) {
    	setPortletData(context);
    	FieldValue myValue = (FieldValue) context.getFlowScope().get("fValue");
    	if (myValue.getId() == 0) {
    		myValue = myFieldValueService.addEntity(myValue);
    	} else{
    		myValue = myFieldValueService.updateEntity(myValue);
            }
    	return success();
    }
    but it doesn't. After debugging I see that everything is working as expected, the only strange thing is that the updated object doesn't stay updated in the context. The only thing I can figure is each time the context is being retrieved from some sort of serialization and that the update isn't getting written out. Any information anyone has would be greatly appreciated.
    Thanks,
    Justen

  2. #2

    Default

    P.S. I forgot to mention that I have well over 20 flows and nearly 100 persisted objects and this problem is consistent across all of them.

    Thanks,
    Justen

Posting Permissions

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