具有被动视图的MVP模式中的用户确认 [英] User Confirmation in MVP Pattern with Passive View

查看:94
本文介绍了具有被动视图的MVP模式中的用户确认的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在继续执行基于Web的MVP模式实现中的任务之前,您将如何处理调用用户确认对话框的问题?它必须在两者之间进行回发,并且确认将超出调用它的presenter函数的范围.我希望保留纯MVP实施,但有可能吗?

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?

推荐答案

您不能在单个服务器端函数中实现此逻辑.我相信解决这个问题的标准方法要么是

You can't implement this logic in one single server-side function. I believe the standard approach to tackle this is either to

  • 具有多个步骤,每个步骤都涉及到服务器的一次回发.这些步骤之一就是您提到的确认对话框

  • 通过Javascript显示确认对话框

这篇关于具有被动视图的MVP模式中的用户确认的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆