David and Bill
Mostly in SSJS, I'm just starting out in Java, taking a TLCC course. Notes Database is Purchase Request that I wrote about 12 years ago. All the fields are single value. The main document has the first 15 line items with sequential item group by 15 items in response documents. The line item fields are in a subform that is used in both main and response documents of the purchase request.
There will be two databases, the original Purchase Request and new xpages application.
Our CFO likes the Purchase Request application/db so much he wanted to incorporate the Purchase Orders in it as well. I already done that. Now he want the a shipping receipt that the end user fills out with the actual quantities received.
What I need to do is store the information that end user enters for the shipping receipt and store that information, and sum those quantities back into the purchase request document. There can be multiple shipping receipts to handle partial supplied orders. This gives them a record of who, what and when items was received.
My thought was to present the line items to end user with a received quantity input. Then processing those values, summing those values back into the purchase request and writing the line items detail alone with quantities entered into a shipping receipt document.
My problem is understand how to process the quantities, when the values are not bound to any datasource yet. Or maybe I'm just not thinking problem through correctly.
Here a prototype code I did using nested repeats generating the Notes field names to bind too. The back end form has 8 fields fItem01, fPD01, fRQR01, fTRQR01, fItem02..., fItem03, fPD03 so on. all single value text
The two buttons I have reads the inputText values and the other get the value by component. The second time the "Read Componients" is executed I get a exception on the rowData var.
Thanks both you for your comments.
<xp:this.data>
<xp:dominoView var="view1" viewName="vwMultItem"
ignoreRequestParams="true">
</xp:dominoView>
</xp:this.data>
<xp:panel>
<xp:table>
<xp:tr>
<xp:td></xp:td>
<xp:td></xp:td>
</xp:tr>
<xp:repeat id="repeat1" rows="30" value="#{view1}"
var="rowData" indexVar="rowIndex" repeatControls="true" first="0">
<xp:panel id="panelRepeatData">
<xp:this.data>
<xp:dominoDocument var="document1"
action="openDocument"
documentId="#{javascript:rowData.getNoteID();}"
formName="frMultItem" ignoreRequestParams="true">
</xp:dominoDocument>
</xp:this.data>
<xp:tr>
<xp:table>
<xp:repeat id="repeat2" rows="3"
var="rowItem" first="0" repeatControls="true"
indexVar="cptIndex">
<xp:this.value><![CDATA[#{javascript:["01", "02", "03"]}]]></xp:this.value>
<xp:tr>
<xp:repeat id="repeat3" first="0"
rows="3" var="fieldName" repeatControls="false">
<xp:this.value><![CDATA[#{javascript:["fItem"+rowItem,"fPD"+rowItem,"fRQR"+rowItem]}]]></xp:this.value>
<xp:td>
<xp:text escape="true"
id="computedField1" value="#{document1[fieldName]}">
</xp:text>
</xp:td>
</xp:repeat>
<xp:td>
<xp:inputText
id="inputText_${rowIndex}_${cptIndex}">
</xp:inputText>
</xp:td>
</xp:tr>
</xp:repeat>
</xp:table>
</xp:tr>
</xp:panel>
</xp:repeat>
</xp:table>
</xp:panel>
<xp:panel id="panelResult">
<xp:table>
<xp:tr>
<xp:td>
<xp:button value="Read inputText" id="button1">
<xp:eventHandler event="onclick"
submit="false">
<xp:this.script><![CDATA[alert("start");
//var domEl = dojo.byId('repeat3');
var domEL = dojo.query("tbody tr td input");
//alert("domEL value " + domEL[0].value);
var values = "";
dojo.forEach(domEL, function(node){
values += node.value + " "
});
alert( "values " + values);
//var textBoxes = domEl[0].value;
//var certainValue = textBoxes[0].value;
//alert("Value of component " + certainValue);]]></xp:this.script>
</xp:eventHandler>
</xp:button>
</xp:td>
<xp:td>
<xp:button id="button2" value="Read Components">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="panelResult">
<xp:this.action><![CDATA[#{javascript:sessionScope.cpValue = "Test";}]]></xp:this.action>
</xp:eventHandler></xp:button>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:text escape="true" id="computedField2"
value="#{sessionScope.cpValue}">
</xp:text>
</xp:td>
</xp:tr>
</xp:table>
</xp:panel>