User Confirmation in MVP Pattern with Passive View

最后都变了- 提交于 2019-12-12 03:41:43

问题


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:


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


来源:https://stackoverflow.com/questions/3273570/user-confirmation-in-mvp-pattern-with-passive-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!