Xpages 重复处理下一个 rowData 或 Doc [英] Xpages get a handle on next rowData or Doc in a repeat

查看:25
本文介绍了Xpages 重复处理下一个 rowData 或 Doc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的重复控件中,我希望能够处理下一行中的数据,以便修改当前行中显示的数据(我有上下移动操作,我不想如果无法移动,则显示它们).

In my repeat control I want to be able to get a handle on data in the next row in order to modify what data is displayed in my current row (I have move up and down actions, and I don't want to display them if the move is not possible).

看来我应该可以做到这一点.可能我不能从重复本身内部进行,因为当它正在编写重复时,它不会知道下一次重复的数据.但是不是应该有一个相当简单的方法来获取下一个文档吗?

It seems I should be able to do this. Probably I cannot from within in the repeat itself, as when it is writing the repeat it will not know the data for the next repeat. But shouldn't there be a fairly easy way to get the next document?

这是我的重复控件的简化版本:

Here is a reduced version of my repeat control:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">

<xp:repeat
                id="repeat1"
                var="rowData"
                indexVar="repeatIndex"
                value="#{view1}"><xp:this.facets>
                    <xp:text
                        disableTheme="true"
                        xp:key="header"
                        escape="false"
                    >
                        <xp:this.value><![CDATA[<table class='lotusTable repeatRowColors' border='0' cellspacing='0' cellpadding='0' width='800px'>
<tr class ='lotusFirst lotusSort scope='col'>
<th class ='loutsFirstCell'></th>
<th class ='loutsFirstCell'>Category</th>
<th class ='lotusCenter'>Move</th>
<th>Task</th>
</tr>
</thead>]]></xp:this.value>

                    </xp:text>
                    <xp:text
                        disableTheme="true"
                        xp:key="footer"
                        escape="false"
                    >
                        <xp:this.value><![CDATA[</table>]]></xp:this.value>

                    </xp:text>
                </xp:this.facets>
                <xp:this.rows><![CDATA[#{javascript:var rows:Integer = viewScope.get("rows");
if (rows == null)
{return 5}
else
{return rows}}]]></xp:this.rows>
                <xp:tr id="rowDataContainer">

                    <xp:td
                        style="width:55px;min-width:55px;max-width: 55px;">
                        <xp:text
                            escape="true"
                            id="computedField2">
                            <xp:this.value><![CDATA[#{javascript:rowData.getColumnValue("category");}]]>
                            </xp:this.value>
                        </xp:text>
                    </xp:td>

                </xp:tr>
            </xp:repeat>
</xp:view>

推荐答案

你可以得到视图的下一行重复

You can get view's next row within the repeat with

var nextRow = view1.getAllEntries().getNthEntry(repeatIndex + 2);

"view1" 是分配给重复控件的 xp:dominoView,"repeatIndex" 是 xp:repeat 的 indexVar.

"view1" is the xp:dominoView assigned to repeat control and "repeatIndex" is the indexVar of xp:repeat.

你可以得到下一行文档的 UniqueID 然后用

You can get next row document's UniqueID then with

nextRow ? nextRow.getUniversalID() : ""

和例如带有

nextRow ? nextRow.getDocument().getItemValueString("Form") : ""

相应地,您可以使用

var prevRow = view1.getAllEntries().getNthEntry(repeatIndex);

这篇关于Xpages 重复处理下一个 rowData 或 Doc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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