动态数据绑定? [英] Dynamic Data Binding?
问题描述
我的 Notes 文档中有几个字段
I have several fields on my Notes Document
字段A_1字段A_2字段A_3字段A_4
FieldA_1 FieldA_2 FieldA_3 FieldA_4
字段B_1场B_2场B_3字段B_4
FieldB_1 FieldB_2 FieldB_3 FieldB_4
在复合控件上我有 2 个编辑框场A字段B
On a composite control I have 2 edit boxes FieldA FieldB
我有一个 CompositeData.ATM_NUM 定义了一个自定义控件,它是一个下拉列表,值为 1、2、3、4.
I have a compositeData.ATM_NUM defined a custom control that is a drop down list with the values 1,2,3,4.
如何使用可用的复合数据将控件上的编辑框绑定到相应的文档字段?
How do I bind the edit boxes on my control to their corresponding document fields using the composite data available?
例如,我想做这样的事情:"FieldA_"+复合数据.ATM_NUM.
For example, I wanted to do something like: "FieldA_"+ compositeData.ATM_NUM.
我在此线程中尝试了 javascript 解决方案:
I tried the javascript solution in this thread:
但它似乎不起作用.
推荐答案
尝试以下值作为例如字段 A:
Try the following as value for e.g. field A:
<xp:inputText value="#{document['FieldA'+compositeData.ATM_NUM]}" />
您还可以扩展自定义控件的属性以包含整个字段名称(从而将例如FieldA_1"传输到自定义控件).那么您应该能够执行以下操作:
You could also extend the property of the custom control to include the whole field name (and thereby transfer e.g. "FieldA_1" to the custom control). Then you should be able to do the following:
<xp:inputText value="#{document[compositeData.fieldName]}" />
这篇关于动态数据绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!