admin管理员组文章数量:1336281
I am working on an Oracle APEX application with an Interactive Grid (IG). When the user submits or saves the IG, I want to perform the following actions:
Insert the IG rows into a custom table based on the IG data before saving. If there's a problem or validation error, reload the grid and avoid saving the data. Currently, I am using a Dynamic Action on the "Before Page Submit" event to:
Loop through all rows in the IG. Insert the IG data into an APEX collection. Process the data from the collection into my tables. However, I am encountering the following issue:
Problem: Sometimes, the page is submitted before all the data from the Interactive Grid is inserted into the APEX collection, resulting in exceptions and partial data processing. What I Have Tried: I ensured the Dynamic Action runs before the page submission. Added server-side processes to handle the data in the collection. My Questions: How can I ensure that all the rows from the IG are processed into the APEX collection before the page is submitted? Is there a way to delay or pause the submit action until the collection processing is complete? Example Code: Here’s a snippet of the JavaScript I use to loop through the IG rows and insert them into the collection:
apex.server.process("CLEAR_PaymentVoucherJournal_COLLECTION");
var model = apex.region("my_ig").widget().interactiveGrid("getViews",
"grid").model;
var rows = model.getRecords();
rows.forEach(function(row) {
// Logic to add rows to collection
apex.server.process("ADD_TO_COLLECTION", {
x01: row.values.COLUMN_NAME1,
x02: row.values.COLUMN_NAME2
});
});
Expected Behavior: All IG rows should be added to the collection before the page submits. If any errors occur during processing, the page should reload or cancel submission. Actual Behavior: The page sometimes submits before all rows are added to the collection, causing exceptions.
Would appreciate any insights or solutions for ensuring proper synchronization between IG processing and page submission. Thank you!
版权声明:本文标题:Interactive Grid in Oracle APEX: Ensure Rows Are Processed Before Submit to Avoid Exceptions - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742407232a2469070.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论