Re: Committing data in a repeating section
I have an UX for adding/editing an Order with the Ordered Services for that order in the repeating section. The user enters some fields in the 'order parent' part, then clicks a button that fills in the services part. The ajax callback in that button uses something similar to the following for populating the repeating section:
So the repeating section gets nicely populated, but then when i submit the form, it doesn't save anything in the db, even not the 'order parent' part .
When adding your code to add all the repeating section fields to the dirtycolumns , it now saves correctly all the rows from the repeating section, but parent fields are still blank. The only way i can have it save correctly upon submit is by explicitely modifying any field in the repeating section ( it doesn't matter what row ) in addition to the code for the dirtycolumns, and then and only then it's all saved to the db...
Frustrating...
I have an UX for adding/editing an Order with the Ordered Services for that order in the repeating section. The user enters some fields in the 'order parent' part, then clicks a button that fills in the services part. The ajax callback in that button uses something similar to the following for populating the repeating section:
Code:
js = <<%str% var rows = __rows__; var setFocusToFirst = true; var nullOutExistingData = true; var repeatingSectionId = 'CONTAINER_1'; {dialog.object}._setRepeatingSectionRowCount(repeatingSectionId,rows,setFocusToFirst,nullOutExistingData); var _d = {}; __RowData__ {dialog.object}.prepare(); {dialog.object}.populate(_d); {dialog.object}.refreshClientSideComputations(); {dialog.Object}.setFocus('SERVICEID',1); %str% ' build the repeating section data - this is in a while rs.nextrow() loop rowData = rowData +"_d['SERVICEID:"+cnt+"'] = '"+ServiceID+"'; " rowData = rowData +"_d['DESCRIPTION:"+cnt+"'] = '"+js_escape(rs.Data("Name"))+"'; " rowData = rowData +"_d['QUANTITY:"+cnt+"'] = '"+DefaultQuantity+"'; " rowData = rowData +"_d['COST:"+cnt+"'] = '"+curCost+"'; " rowData = rowData +"_d['UNITPRICE:"+cnt+"'] = '"+curSell+"'; " js = stritran(js,"__RowData__",rowData) js = stritran(js,"__rows__",convert_type(cnt,"c"))
When adding your code to add all the repeating section fields to the dirtycolumns , it now saves correctly all the rows from the repeating section, but parent fields are still blank. The only way i can have it save correctly upon submit is by explicitely modifying any field in the repeating section ( it doesn't matter what row ) in addition to the code for the dirtycolumns, and then and only then it's all saved to the db...
Frustrating...
Comment