Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
476 views
in Technique[技术] by (71.8m points)

xpages - Dynamic Data Binding?

I have several fields on my Notes Document

FieldA_1 FieldA_2 FieldA_3 FieldA_4

FieldB_1 FieldB_2 FieldB_3 FieldB_4

On a composite control I have 2 edit boxes FieldA FieldB

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?

For example, I wanted to do something like: "FieldA_"+ compositeData.ATM_NUM.

I tried the javascript solution in this thread:

Binding an edit box within a custom control to a form field programatically

But it did not seem to work.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try the following as value for e.g. field A:

<xp:inputText value="#{document['FieldA'+compositeData.ATM_NUM]}" />

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]}" />

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...