XPages - 在嵌入式自定义控件中绑定文档数据源
我创建了一个绑定到 Domino 文档数据源的自定义控件。我将其嵌入到页面中,以便可以在 Dojo 对话框中显示它。它有 2 个属性:dialogId 和 docId。文档数据源的文档ID 属性设置为compositeData.docId。在该页面中,我将 docId 属性设置为 viewScope 变量,该变量将在单击视图中的条目时设置。我想要完成的是对话框将显示当前视图条目(被单击)代表的文档。但似乎compositeData.docId 没有在部分甚至完全刷新时设置。有没有办法将自定义控件绑定到文档?我需要具有此绑定,以便在提交对话框时可以轻松地进行服务器端验证。或者如果还有其他的方法,也可以放在这里吗?多谢!
I created a custom control that is binded to a a Domino Document data source. I embedded it in a page so that I can display it in a Dojo dialog. It has 2 properties: dialogId and docId. The document data source's Document ID property is set to compositeData.docId. In the page, I set the docId property to a viewScope variable, that will be set when an entry in a view is clicked. What I want to accomplish is that the dialog will display the document that the current view entry (that was clicked) represents. But it seems that the compositeData.docId is not set on partial or even full refresh. Is there a way to do this that the custom control will be binded to the document? I need to have this binding so that I can easily do a server-side validation when I submit the dialog. Or if there is another way, can you also put it here? Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将数据源设置为文档,然后编辑模式,然后您就有地方计算文档ID,我通常将文档ID计算为viewScope,当我单击重复控件中的项目时设置
更多详细信息此处。
set the datasource as the document, and then edit mode, then you have a place to compute the doc id, i usually compute the doc id to a viewScope, that i set when i click the item in the repeat control
More details here.
我希望通过自定义控制参数而不是范围变量来传输 DocId。使用 Scope 打破了自包含的自定义控件设计原则。您可以使用 yourCC.PropertyMap 来实际更新值,因此参数的移交将起作用 - 当然,您的控件随后需要刷新,以便重新计算数据源。希望有帮助。
I would prefer the DocId to be transfered via the custom control parameters rather than a Scope variable. Using the Scope breaks the custom control design principle of being self contained. You can use the yourCC.PropertyMap to actually update a value, so the hand over of the parameter will work - of course your control then needs to be refreshed so the data source is recomputed. Hope that helps.