How would you handle calling a user confirmation dialog before continuing with a task in a web-based MVP pattern implementation? It'll have to do a postback in between and the confirmation would go out of the scope of the presenter function that called it. I'd prefer to keep to a pure MVP implementation but is it even possible?
Asked
Active
Viewed 283 times
1 Answers
1
You can't implement this logic in one single server-side function. I believe the standard approach to tackle this is either to
- Have multiple steps that each involve one postback to the server. One of these steps would be the confirmation dialog you mentioned
or
- Show the confirmation dialog via Javascript

Adrian Grigore
- 33,034
- 36
- 130
- 210
-
Just wondering, how would I indicate that I want to resume the operation where I left off? – Jonn Jul 19 '10 at 22:43
-
@Jonn: Do you mean from the user's perspective? Or how the server would store this kind of information for later retrieval? – Adrian Grigore Jul 20 '10 at 09:37
-
The latter one. I'm having trouble picturing the scenario without having some sort of enumeration that indicates the current process the user is undergoing. – Jonn Jul 20 '10 at 23:24
-
@Jonn: I can't think of any other way to do it. You have to use persistent storage at some point, be it in the session storage or in your database. – Adrian Grigore Jul 21 '10 at 09:45
-
Ah.. well. Just though that there might be some mechanism that I didn't know of. Thanks. XD – Jonn Jul 21 '10 at 23:53