OK, stipulating to the fact that this could easily be pilot error, I'm seeing an issue that I can't seem to figure out.
I have a read-only grid with an editable detail part. To accomplish what I need I've created a callback calculation routine, a javascript action to call that routine and, in the OnDetailViewRender server-side event of the grid, I return javascript to run that action. The callback needs the value of a couple of fields in the detail part and then returns javascript to set other fields with the result. To give the callback the required information, instead of selecting "Compute current row data" in the Action Javascript dialog, I've created a javascript function which I put in the "Additional Data to Submit" field. The function reads the values from the detail part using getValue.
So far, so good. Everything fires when it's supposed to. The callback (with the exception I'm about to note) gets the data it needs, does its calculations and is able to return javascript to set the appropriate field(s) on the detail form. The problem is the following: If I CHANGE the value of one of the fields that the javascript function is accessing with getValue, then click "Save", the variable sent to the callback contain the PREVIOUS value of the field. That is, if, say, I change "Rate" from .90 to 1.00, then click Save, the callback (which is definitely triggered AFTER the data has been saved), gets .90 instead of 1.00. The 1.00 shows in the "Rate" field in the detail form; if I set an OnChange event handler for the "Rate" field to do a getValue and display the return value in an alert, I see 1.00. I have no idea why the callback is getting .90.
Again, it could easily be pilot error (either a lack of understanding of the fundamentals or a coding error), but I've cobbled up a small test case to exhibit the problem (it's called setValue because I was too lazy to change the name of the test case I posted previously).
Any ideas would be gratefully accepted.
BTW, I'm using 3550-4650.
I have a read-only grid with an editable detail part. To accomplish what I need I've created a callback calculation routine, a javascript action to call that routine and, in the OnDetailViewRender server-side event of the grid, I return javascript to run that action. The callback needs the value of a couple of fields in the detail part and then returns javascript to set other fields with the result. To give the callback the required information, instead of selecting "Compute current row data" in the Action Javascript dialog, I've created a javascript function which I put in the "Additional Data to Submit" field. The function reads the values from the detail part using getValue.
So far, so good. Everything fires when it's supposed to. The callback (with the exception I'm about to note) gets the data it needs, does its calculations and is able to return javascript to set the appropriate field(s) on the detail form. The problem is the following: If I CHANGE the value of one of the fields that the javascript function is accessing with getValue, then click "Save", the variable sent to the callback contain the PREVIOUS value of the field. That is, if, say, I change "Rate" from .90 to 1.00, then click Save, the callback (which is definitely triggered AFTER the data has been saved), gets .90 instead of 1.00. The 1.00 shows in the "Rate" field in the detail form; if I set an OnChange event handler for the "Rate" field to do a getValue and display the return value in an alert, I see 1.00. I have no idea why the callback is getting .90.
Again, it could easily be pilot error (either a lack of understanding of the fundamentals or a coding error), but I've cobbled up a small test case to exhibit the problem (it's called setValue because I was too lazy to change the name of the test case I posted previously).
Any ideas would be gratefully accepted.
BTW, I'm using 3550-4650.
Comment