具有被动视图的 MVP 模式中的用户确认

发布于 2024-09-10 15:45:05 字数 107 浏览 6 评论 0原文

在基于 Web 的 MVP 模式实现中继续执行任务之前,您将如何处理调用用户确认对话框?它必须在两者之间进行回发,并且确认将超出调用它的演示者函数的范围。我更愿意保留纯粹的 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

抹茶夏天i‖ 2024-09-17 15:45:05

您无法在单个服务器端函数中实现此逻辑。我相信解决此问题的标准方法是

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

  • 通过 Javascript 显示确认对话框

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文