UI 模式允许用户添加具有无限子项目的项目

发布于 2024-09-10 18:03:44 字数 593 浏览 0 评论 0原文

我正在编写一个 ASP.NET 应用程序。我需要包含一个页面,用户可以在其中添加具有多组子项目的项目,每组子项目的数量不受限制。子项本身包含 10 到 15 个字段,因此需要相当多的 UI 空间。

作为我的意思的一个例子,用户需要能够向系统添加业务记录,包括任意数量的员工记录和任意数量的资产记录。

我通常执行此操作的方法是使用顶部带有一组选项卡的 MultiView 控件。选项卡在多视图的视图之间切换。第一个选项卡用于业务记录,第二个选项卡用于员工记录,第三个选项卡用于资产记录。员工和资产的视图最初是空的,有一个用于添加新员工(或资产)的按钮。单击此按钮时,将回发页面并动态添加用户控件以捕获员工(或资产)的详细信息。

有一个保存按钮可以将整个对象图保存到数据库中。

这对于编程和维护来说是相当复杂的,而且我通常会在管理动态用户控件的 ViewState 时遇到麻烦。显然,页面上的 ViewState 也会变得相当大,使得页面变得相当慢。

优点是它是一个非常直观的用户界面,用户可以理解,并且用户可以添加所有内容并在将任何内容保存到数据库之前检查所有内容。

您能否建议您可能为此使用的任何其他 UI 模式以及任何优点或缺点?

谢谢

大卫

I'm writing an ASP.NET app. I need to include a page where the user can add an item which has several sets of subitems, each of which sets is unlimited in number. The subitems themselves contain between 10 and 15 fields, so need a fair bit of UI space.

As an example of what I mean, the user needs to be able to add a Business record to the system, including any number of Employee records and any number of Asset records.

The way I normally do this is by using a MultiView control with a set of tabs at the top. The tabs switch between the Views of the MultiView. The first tab will be for the Business record, the second will be for Employee records, and the third for Asset records. The Views for Employees and Assets are initially empty bar a button to add a new Employee (or Asset). When this button is clicked, the page is posted back and a user control is added dynamically to capture the details of the Employee (or Asset).

There is one save button that saves the whole object graph to the database.

This is quite complicated to program and maintain and I usually encounter headaches to do with managing ViewState for the dynamic user controls. Obviously, the ViewState on the page can also become quite large, making the page quite slow.

The advantage is that it is quite an intuitive UI for the user to understand, and the user can add everything and check it all before saving anything to the database.

Can you please suggest any other UI patterns that you might use for this and any advantages or disadvantages?

Thanks

David

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

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

发布评论

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

评论(2

东走西顾 2024-09-17 18:03:44

看看 Quince,一个 UX 模式存储库,可以帮助您激发一些灵感:http://quince.infragistics.com /

关于视图状态,如果您没有在没有状态的情况下进行 MVC,您是否考虑过以下技巧:

  • 在非上下文元素(即:标签)上禁用 ViewState
  • 通过定义 bzips>base64 的自定义处理程序来压缩 ViewState编码。您会对最终在客户端上节省的空间量感到惊讶将
  • 视图状态存储在服务器上,创建一个请求 id,并将该 id 与应用程序缓存绑定在一起,并使用过期窗口 = 会话生命周期(非滑动),然后用您的引导来回替换视图状态。

干杯,
弗洛里安

Have a look at Quince, a UX pattern repository that can help you lift some inspiration : http://quince.infragistics.com/

Regarding the viewstate, if you're not doing MVC without state, have you considered the following tricks:

  • Disable ViewState on non-context elements (ie: labels)
  • Compress the ViewState by defining a custom handler that bzips>base64 encodes. You'll be surprised at the amount of space you end-up saving on the client
  • Store the viewstate on the server, create a request id, and tie this id to the app cache with an expiry window = to the session lifespan (non-sliding), then substitute the viewstate with your guid back and forth.

Cheers,
Florian

绅刃 2024-09-17 18:03:44

我喜欢您使用选项卡在视图之间导航的多视图控件的设计。对我来说,我有时会看到很大的景色,有时又需要绕过一些步骤。您几乎处于向导控件的边缘,但我发现您的每个步骤都太复杂,无法使用官方向导控件。

就我而言,我将每个视图分离到一个特定的网页中。使用您的示例,考虑创建三个页面:Business.aspx、Employee.aspx 和 Asset.aspx。如果您有验证 Web 表单的代码,则可以在每个网页中引用它。我这样做是因为在我的情况下,我在每个“步骤”上添加了许多记录。我不想担心每次回发时必须正确重新创建视图状态的开销和错误空间。您的 Business.aspx 页面知道如何照顾自己并保持有效,而不必担心有效的员工记录或数据。当我遇到这个问题时,我的多视图模式可以轻松地将视图分成单独的页面。哦,假设有人直接浏览到 Asset.aspx,我会显示一条消息解释用户抢先一步,或者制作一个简单的视图表单以允许他们在添加资产之前选择相应的资源和/或员工。

I like your design of the multiview control using the tabs to navigate between the views. For me, I've had times with large views and a time when I needed to bypass some of the steps. You are almost on the edge of a wizard control, but I see each of your steps way too complicated to use the official wizard control.

In my case, I separated each view into a specific web page. Using your example, consider creating three pages: Business.aspx, Employee.aspx and Asset.aspx. If you have code that validates the web forms, then can reference it in each of the web pages. I did this because in my situation, I was adding many records on each "step". I didn't want to worry about the overhead and room for error of having to properly recreate the viewstate with each post back. Your Business.aspx page knows how to take care of itself and be valid without having to worry about valid Employee records or data. When I hit this problem, my multiview pattern made it easy to break the views into separate pages. Oh, say someone browses directly to Asset.aspx, I would either display a message explaining the user jumped the gun OR make a simple view form to allow them to select the respective Resource and/or Employee before the Asset can be added.

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