Xpages Binding to edit control in repeat

I understand how to dynamically bind to an edit control. The backend from has fields fItem01 fItem02 ... fPD01 fPD02 .. fRQR01 fRQR02 .. I can get the values ​​for all fields, but I was able to define a binding to control editing.

I read all the publications on this topic, but did not understand what I was doing wrong. Also tried using a custom control with a property for binding, but that didn't work either.

Thanks for any help on this Bob.

<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> 
+4
source share
1 answer

As you know which fields you want to place in the repeat control, you can fully calculate the fieldName in the internal repeat block with

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

and then use them in the edit control 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> 
+1
source

Source: https://habr.com/ru/post/1497293/


All Articles