Web_Developer
Web_Developer

Reputation: 9

Xpages - Repeat Control field not editable

I used the example from this question as a starting point Getting values from repeat control

the field in example from link above is : <xp:inputText id="inputText1" loaded="true"> <xp:this.value><![CDATA[${javascript:var fieldName = "Help_" + varcollection; return '#{viewScope.' + fieldName + '}';}]]></xp:this.value> <xp:eventHandler event="onchange" submit="true" refreshMode="partial" refreshId="computedField1"></xp:eventHandler></xp:inputText>

The code for the field I have now is a modified version from above :

<xp:inputText id="inputText1" loaded="true"> <xp:this.value><![CDATA[#{javascript:var fieldName = "Tmp_" + @ReplaceSubstring(varcollection," ",""); return '#{viewScope.' + @ReplaceSubstring(fieldName," ","") + '}';}]]></xp:this.value> <xp:eventHandler event="onchange" submit="true" refreshMode="partial" refreshId="panel1" /></xp:inputText>

but for some reason it's not an editable field, any idea why ?

Also, although idea above is good, if I have 4 editable fields in 1 row, I would have to create 4 viewScope variables per row ? Is there another way to store the field values ?

running on Domino 8.5.3

Upvotes: 0

Views: 449

Answers (1)

Michael Saiz
Michael Saiz

Reputation: 1640

Replace #{javascript: with ${javascript. Or change the Code in the value to onLoad (wich is the same as the change between # and $), this should make you fields editable again.

Instead of using 4 or more scope variables per row and you dont know how many you need in the end you could use a Bean that implements com.ibm.xsp.model.DataObject. See Link.The benefit from implementing the DataObject interface is that you can access your beanData direct via EL.

Upvotes: 1

Related Questions