XPage 自定义控件:调用自定义控件中定义的操作 [英] XPage Custom Controls: calling an action defined in a custom controll

查看:41
本文介绍了XPage 自定义控件:调用自定义控件中定义的操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Domino 9.0.1 并且我正在开发一个 XPage 应用程序来充当时间表.在条目页面中,我有一个转发器,其中一个自定义控件重复了 10 次以上.每个控件都有自己的 Java 对象(存储在页面上的 ArrayList 中)和自己的 NotesXspDocument 数据源.我使用自定义控件是为了 1) 在整个应用程序中保持一致的外观和感觉,2) 如果需要对功能或设计进行更改,则应在一个位置进行更改,而不是在整个应用程序中进行多次更改 3)我觉得这种面向对象的风格只是最佳实践.

I am using Domino 9.0.1 and I am developing an XPage application to act as a time sheet. In an entry page, I have a repeater where I have one custom control repeated 10+ times. Each control has its own Java Object (stored in an ArrayList on the page) and its own NotesXspDocument data source. I am using a custom control in order to 1) maintain a constant look and feel throughout the entire application, 2) if changes need to be made to functionality or to design they should be made in one location and not multiple throughout the application 3) i feel that such object oriented styles is just best practice.

我的问题是这个.控件的每个实例都可以保存自己.它可以直接访问其数据源 (NotesXspDocument),过去我对此类设计没有任何问题.由于中继器,我希望能够让用户有机会单击页面上的一个保存按钮,然后遍历每个自定义控件实例并告诉它保存其数据源,而无需让用户单击保存 10 到20 次.我为此类任务所做的所有搜索仅返回授予对页面数据源的自定义控件访问权限,或将函数传递给自定义控件而不授予对内部定义函数的 xpage 访问权限.

My issue is this. Each instance of the control can save itself. It has direct access to its dataSource (NotesXspDocument), and I have had no issues with such designs in the past. Because of the repeater, I want to be able to give the user the opportunity to click on one save button on the page, and then iterate through each custom control instance and tell it to save its datasource without making the user click on save 10 to 20 times. All of the searches that I have made for such a task only return giving a custom control access to a page's datasource, or for passing a function to the custom control and not giving an xpage access to an internally defined function.

有人知道这是否可能吗?

Does anyone know if this is possible?

我可以尝试的另一个想法是将 DominoDocument 添加到后台 java 类,然后告诉 Java 类进行自我保存.

The other idea that I could play with is adding a DominoDocument to the background java class and then telling the Java class to save itself.

有什么建议吗?

非常感谢您提供任何建议和帮助!

Thank you very much in advance for any advice and help!

格雷格

推荐答案

如果您添加一个提交"类型的按钮,它将一次保存所有数据源.

If you add a button of type "Submit" it will save all data sources at once.

这篇关于XPage 自定义控件:调用自定义控件中定义的操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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