views:

41

answers:

1

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
Just wondering, how would I indicate that I want to resume the operation where I left off?
Jonn
@Jonn: Do you mean from the user's perspective? Or how the server would store this kind of information for later retrieval?
Adrian Grigore
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
@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
Ah.. well. Just though that there might be some mechanism that I didn't know of. Thanks. XD
Jonn