Xpages,使用@Unique 在视图面板中继承文档 [英] Xpages, Inherited documents in view panel by using @Unique

查看:22
本文介绍了Xpages,使用@Unique 在视图面板中继承文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个表单项目(文档)和评论(回复回复)我想创建一个视图来显示所选项目的所有评论

I have two forms project(Document) and comment(Response to Response) I want to create a view that displays all comments of selected Project

任何帮助将不胜感激.

推荐答案

我喜欢在 xPages 中做这类事情.

I love doing this type of stuff in xPages.

暂时不要考虑项目和响应.想想唯一ID.为了使项目文档引用注释,您需要为每个注释添加一个唯一的 ID,这些 ID 将相互引用.不要在 xPages 中使用响应文档,我认为没有必要.保存评论时,通过引用此值将父文档的唯一 ID 保存到评论文档的字段中,其中 document1 是父级的数据源,document3 是子级的文档.

For a moment, don't think about project and response. Think uniqueID. In order to make the project document reference the comment you add a unique ID to each of them that will reference each other. Don't use response docs in xPages, there is no need I see. When you save the comment, save the unique ID of the parent document to a field on the comment document by referencing this value where document1 is the datasource of the parent and document3 is the document of the child.

   <xp:modifyField name="uid"
        value="#{javascript:document1.getDocument().getUniversalID()}" 
        var="document3">
    </xp:modifyField>

既然您有一堆父文档和子文档,您可以创建一个分类视图,其中仅捕获评论.使用视图选择公式排除父窗体.使第一列成为您之前捕获的 uniqueID.您现在拥有一个视图,该视图将按父级的唯一 ID 对所有评论进行分类.

Now that you have a bunch of parent and children docs, you create a categorized view where you are only capturing the comments. Use a view selection formula to exclude the parent form. Make the first column the uniqueID that you previously captured. You now have a view that will keep all the comments categorized by the unique id of the parent.

现在在 xpage 中,您现在需要过滤键值.您可以通过计算父文档值的键进行过滤.这里的 document1 是父级.

Now in the xpage you now need to filter on the key value. You filter by computing the keys to the value of the parent document. Here document1 is the parent.

 <xp:dominoView var="view2" viewName="rejections"
        keys="#{javascript:document1.getDocument().getUniversalID()}">
    </xp:dominoView>

这样做的好处是它可以在 viewPanel、dataView 或重复控件中工作,因为您引用的是数据而不是 UI.

The great thing about doing this is it will work in a viewPanel, dataView, or a repeat control since you are referencing the data not the UI.

如果您想对评论进行评论,有几种方法,但我认为它们都具有相同的结构.如果你已经开始考虑重复控件,它们会让你摆脱普通的笔记视图.

If you wanted to do comments of comments there are a couple of approaches but I think they would all have the same structure. If you made it this far start looking at repeat controls they will let you break free of the normal notes views.

这篇关于Xpages,使用@Unique 在视图面板中继承文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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