Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed to know the way to stamp a field within a document collection which is in a repeat control
    text
    copied!<p>I have a repeat control which has its source as a notesdocumentcollection. Inside the repeat control I have a panel that has a datasource and the document id property of the datasource is set to the universal id of the a single document which in my case is the repeat control variable apprDoc (apprDoc.getUniversalID). Thus using the panel datasource I am trying to directly bind each field in the repeat control to the respective back end document. I have a submit button on click of which I need to post the values selected by the user into the backend document and also set some other fields which are not bound to the back end document. I need to get a handle to each document in the document collection in order to set a field value on the backend document. Can someone please suggest a way to do the same, or any other way to achieve the functionality which I am trying to achieve. Please find below the code for the same:</p> <pre><code> &lt;xp:repeat id="repeat1" rows="30" var="apprDoc" indexVar="docIndex" first="0"&gt; &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:// Look up the employee details view to get the employee appraisal details from the current database var curDB:NotesDatabase = session.getCurrentDatabase(); var vwlkApprView:NotesView = curDB.getView("vwlkAllApprApper"); var collDocAppr:NotesDocumentCollection = vwlkApprView.getAllDocumentsByKey(sessionScope.EmployeeID); if(collDocAppr.getCount() != 0){ return collDocAppr; } return null;}]]&gt;&lt;/xp:this.value&gt; &lt;xp:panel id="pnlFG"&gt; &lt;xp:this.data&gt; &lt;xp:dominoDocument formName="frmAppraisal" var="appraisalDoc" action="editDocument" documentId="#{javascript:apprDoc.getUniversalID();}"&gt; &lt;xp:this.querySaveDocument&gt;&lt;![CDATA[#{javascript:var apprDoc:NotesDocument = appraisalDoc.getDocument(); if(requestScope.SubmitFG == true){ apprDoc.replaceItemValue("CurrFGRRStatus","1"); apprDoc.save(); }}]]&gt;&lt;/xp:this.querySaveDocument&gt; &lt;/xp:dominoDocument&gt; &lt;/xp:this.data&gt; &lt;xp:tr&gt; &lt;xp:td styleClass="tdCls" style="width:2%"&gt; &lt;xp:label id="SrNo"&gt; &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:var index = parseInt(docIndex) index = index + 1; index.toString();}]]&gt;&lt;/xp:this.value&gt; &lt;/xp:label&gt; &lt;/xp:td&gt; &lt;xp:td styleClass="tdCls" style="width:20.0%"&gt; &lt;xp:label id="ApeName"&gt; &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:return apprDoc.getItemValueString("AppraiseeName");}]]&gt;&lt;/xp:this.value&gt; &lt;/xp:label&gt; &lt;/xp:td&gt; &lt;xp:td styleClass="tdCls" style="width:15.0%"&gt; &lt;xp:label id="ApeGrade"&gt; &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:return apprDoc.getItemValueString("Appraisee_Grade");}]]&gt;&lt;/xp:this.value&gt; &lt;/xp:label&gt; &lt;/xp:td&gt; &lt;xp:td styleClass="tdCls" style="width:15.0%"&gt; &lt;xp:div style="text-align:center"&gt; &lt;xp:label id="appeTotImpRate" style="font-size:10pt;color:rgb(255,0,0);font-weight:bold"&gt; &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:return apprDoc.getItemValueDouble("AppeTotImpRate").toFixed(2);}]]&gt;&lt;/xp:this.value&gt; &lt;/xp:label&gt; &lt;/xp:div&gt; &lt;/xp:td&gt; &lt;xp:td styleClass="tdCls" style="width:15.0%"&gt; &lt;xp:div style="text-align:center"&gt; &lt;xp:label id="apprTotImpRate" style="color:rgb(255,0,0);font-size:10pt;font-weight:bold"&gt; &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:return apprDoc.getItemValueDouble("ApprTotImpRate").toFixed(2);}]]&gt;&lt;/xp:this.value&gt; &lt;/xp:label&gt; &lt;/xp:div&gt; &lt;/xp:td&gt; &lt;xp:td styleClass="tdCls" style="width:15.0%"&gt; &lt;xp:div style="text-align:center"&gt; &lt;xp:label id="revTotImpRate" style="font-size:10pt;color:rgb(255,0,0);font-weight:bold"&gt; &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:return apprDoc.getItemValueDouble("RevTotImpRate").toFixed(2);}]]&gt;&lt;/xp:this.value&gt; &lt;/xp:label&gt; &lt;/xp:div&gt; &lt;/xp:td&gt; &lt;xp:td styleClass="tdCls" style="width:10.0%"&gt; &lt;xp:div style="text-align:center"&gt; &lt;xp:comboBox id="appeGrades" value="#{appraisalDoc.ApperFinalGrade}" style="width:50.0px" disableClientSideValidation="true"&gt; &lt;xp:this.validators&gt; &lt;xp:validateRequired&gt; &lt;xp:this.message&gt;&lt;![CDATA[#{javascript:var index = parseInt(docIndex) index = index + 1; "Please select a final grade in row number " + index.toString();}]]&gt;&lt;/xp:this.message&gt; &lt;/xp:validateRequired&gt; &lt;/xp:this.validators&gt; &lt;xp:selectItem itemLabel="-" itemValue=""&gt; &lt;/xp:selectItem&gt; &lt;xp:selectItem itemLabel="1" itemValue="1"&gt; &lt;/xp:selectItem&gt; &lt;xp:selectItem itemLabel="2" itemValue="2"&gt; &lt;/xp:selectItem&gt; &lt;xp:selectItem itemLabel="3" itemValue="3"&gt; &lt;/xp:selectItem&gt; &lt;xp:selectItem itemLabel="4" itemValue="4"&gt; &lt;/xp:selectItem&gt; &lt;xp:selectItem itemLabel="5" itemValue="5"&gt; &lt;/xp:selectItem&gt; &lt;/xp:comboBox&gt; &lt;/xp:div&gt; &lt;/xp:td&gt; &lt;/xp:tr&gt; &lt;/xp:panel&gt; &lt;/xp:repeat&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload