0

Just for reference before mentioning the problem I would like to say that I have asked to same question on IBM Lotus forum(http://www-10.lotus.com/ldd/ndseforum.nsf/xpTopicThread.xsp?documentId=2AD7C8F89D8930E685257BD50022A9E9) and I have not received any reply for the same in last 2 weeks.

So, I have a typical xpage dropdown menu with say around 40-50 leaf nodes, Every leaf node submits a specific value (using submitValue property) which is then evaluated and action is performed. However, the problem is that, after the action is performed if I try to refresh the page i get the browser notification for re-submission (I believe that it is some kind of programming error by me, however I don't know how to resolve it.)

One example to make it more clear: I have a delete node inside the dropdown. It basically deletes the selected entries from the view(generated using repeat control) and then refreshes the view content. But at this point of time if I try to refresh the page then I get the notification of re-submission by the browser. If I accept it, then it tries to delete it again (which I prevent it but still this shouldn't happen) and if I don't accept it, it just doesn't refresh the page. Any reply would be appreciated. Thank you in advance. Hoping to hear some suggestions. (Please let me know if event he code is required)

Chintan Parekh
  • 1,101
  • 1
  • 12
  • 31
  • As mentioned by @Per Henrik Lausten, you need GET request so browser will not prompt to resubmit previous POST request... Or, if you stay on the same page, use partial refresh. – Frantisek Kossuth Sep 16 '13 at 11:07

1 Answers1

1

I believe you need to implement the Post/Redirect/Get pattern to avoid re-posting on refresh.

Here's a solution by Tommy Valand for XPages for that pattern: http://dontpanic82.blogspot.dk/2010/06/xpages-avoid-saving-duplicate-documents.html

Per Henrik Lausten
  • 21,331
  • 3
  • 29
  • 76
  • Well, this is definitely a good solution for avoiding document duplicates. However, the problem I am facing is specific to dropdown menus in xpages. Every node in dropdown menu has a property named submitValue. When we pass a value and perform action it works really fine with no problem. However, the problem(resubmission problem) arises only when you hit the browser refresh button. If I refresh the browser by pressing enter in the url feed then it works fine. I hope I am describing it correctly as it is really a wierd problem. – Chintan Parekh Sep 16 '13 at 06:50
  • My idea is that you use the example code by Tommy to create your own Post/Redirect/Get pattern that you use in your action. So once the action has completed you end up redirecting back to the same page. – Per Henrik Lausten Sep 16 '13 at 06:55
  • Ya, I get your point. Already working on it. I will keep this topic live to post a final solution if it works out and so probably could be helpful to someone else. Thank you. – Chintan Parekh Sep 16 '13 at 07:09