Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic Data Binding?

Tags:

xpages

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.

like image 822
Bruce Stemplewski Avatar asked May 27 '26 14:05

Bruce Stemplewski


1 Answers

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]}" />
like image 124
Per Henrik Lausten Avatar answered Jun 02 '26 17:06

Per Henrik Lausten