gpt4 book ai didi

Xpages 绑定(bind)到重复编辑控件

转载 作者:行者123 更新时间:2023-12-02 04:10:35 25 4
gpt4 key购买 nike

我在理解如何动态绑定(bind)到编辑控件时遇到问题。后端有字段 fItem01 fItem02... fPD01 fPD02.. fRQR01 fRQR02.. 我可以获取所有字段的值,但能够定义编辑控件的绑定(bind)。

我已阅读有关此主题的所有帖子,但尚未弄清楚我做错了什么。还尝试使用带有绑定(bind)属性的自定义控件,但这也不起作用。

感谢您对此的任何帮助鲍勃

<xp:this.data>
<xp:dominoView var="view1" viewName="vwMultItem"></xp:dominoView>
</xp:this.data>
<xp:table border="1">
<xp:tr>
<xp:td>
<xp:label value="Title" id="label1"></xp:label>
</xp:td>
<!--<xp:td></xp:td>-->
</xp:tr>
<xp:repeat id="repeat1" rows="1" value="#{view1}" var="row">
<xp:panel id="panelDocData">
<xp:this.data>
<xp:dominoDocument var="document1"
formName="frMultItem" action="editDocument"
documentId="#{javascript:row.getNoteID();}">
</xp:dominoDocument>
</xp:this.data>
<xp:repeat id="repeat2" rows="3" var="rowItem" first="0"
indexVar="indexVar">
<xp:this.value><![CDATA[#{javascript:new Array("01", "02", "03")}]]></xp:this.value>
<xp:tr>
<xp:repeat id="repeat3" first="0" rows="2"
var="rowName">
<xp:this.value><![CDATA[#{javascript:new Array("fItem","fPD")}]]></xp:this.value>
<xp:td>
<xp:text escape="true" id="computedField1">
<xp:this.value><![CDATA[#{javascript:document1.getItemValueString(rowName+rowItem);
}]]></xp:this.value> </xp:text>
</xp:td>
</xp:repeat>
<xp:td>
<xp:inputText id="inputText1"
value="#{javascript:'#{document1.fRQR'+'01'+'}'}">
</xp:inputText></xp:td>
</xp:tr>
</xp:repeat>
</xp:panel>
</xp:repeat>
</xp:table>

最佳答案

当您知道要将哪些字段放入重复控件中时,您可以使用

完全计算内部重复 block 中的 fieldName

javascript:["fItem"+rowItem,"fPD"+rowItem,"fRQR"+rowItem]

然后在编辑控件的值 EL #{document1[fieldName]} 中使用它们。

<xp:repeat
id="repeat2"
var="rowItem"
indexVar="indexVar">
<xp:this.value><![CDATA[#{javascript:["01", "02", "03"]}]]></xp:this.value>
<xp:tr>
<xp:repeat
id="repeat3"
var="fieldName">
<xp:this.value><![CDATA[#{javascript:["fItem"+rowItem,"fPD"+rowItem,"fRQR"+rowItem]}]]></xp:this.value>
<xp:td>
<xp:inputText
id="inputText2"
value="#{document1[fieldName]}">
</xp:inputText>
</xp:td>
</xp:repeat>
</xp:tr>
</xp:repeat>

关于Xpages 绑定(bind)到重复编辑控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18258246/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com