Looping through tabular form collection prior to page submit
Hi,
I have a tabular region which has updateable from and to dates.
As these are altered (on change jquery selector) it automatically updates the time taken (X weeks and Y days) column using this
fromdate_id = 'f04_' + $(this.triggeringElement ).attr('id').substr(4);
todate_id = 'f05_' + $(this.triggeringElement ).attr('id').substr(4);
$x('P44_DATE1').value = $("#" + fromdate_id).val();
$x('P44_DATE2').value = $("#" + todate_id).val();
Then fires a PLSQL true action to get the time difference from the two date items (basically I can do this easily in PLSQL and have no idea how to do it in JS, but that's beside the point)
However. I also want to update the page items outside the tab form region showing the overall start and end dates.
These need to be the min of the from dates in the table and the max of the to_dates in the table.
I tried adding another true action to my DA to do the following
for i in 1..apex_application.g_f04.count loop.....
:P44_START_DATE := least(:P44_START_DATE,apex_application.g_f04(i) etc etc......
end loop;
But it didn't work. I suspect I can't loop around that collection in a DA?
Is there any way that I can loop through the tab form rows and get the min max dates immediately on one of them changing?
Edited by: Mark BT52 on Mar 19, 2013 10:17 AM
Edited by: Mark BT52 on Mar 19, 2013 10:19 AM