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?
+1
A:
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
2010-07-17 23:11:40
Just wondering, how would I indicate that I want to resume the operation where I left off?
Jonn
2010-07-19 22:43:46
@Jonn: Do you mean from the user's perspective? Or how the server would store this kind of information for later retrieval?
Adrian Grigore
2010-07-20 09:37:12
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
2010-07-20 23:24:39
@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
2010-07-21 09:45:53
Ah.. well. Just though that there might be some mechanism that I didn't know of. Thanks. XD
Jonn
2010-07-21 23:53:31