Hello everyone,
I am trying to update my IG, without submitting the page, using AJAX Callback that is activated by Dynamic action on button clicked.
My editable IG is Primanja po danima with the static id of primanja-po-danima.
I have created AJAX Callback called updateTable whit type of Interactive Grid - Automatic Row Processing (DML) and I set target type to be PL/SQL Code where I perform simple create, update and delete on table rows.
Here is the picture of my AJAX Callback setup:
The problem is that when the process is complete, I got the success message, but data is not saved in the database.
I use another dynamic action to set values of some fields in the IG, using IG model forEach function, where I set value on each record field.
model.forEach(function (record) {
apex.region(staticID).widget().interactiveGrid("getViews", "grid").model.setValue(record, "FIELD", value);
}
When I change value on some field in IG, the change is registered in Database, but when I set it as follows, the changes are not there, and that field has value of null. (Tested with regular submit page and DML process after submit)
I am calling my AJAX Callback from JavaScript code block:
But with this I have some problems as well. When I click on button, the JavaScript code is executed, the process is fired and I got success message logged in console, but the moment I click on button, I got warning massage on IG that says:
There are unsaved changes. Do you want to continue?
In the console I also got warning message that says: process does not contain pl/sql code
Does anyone know how to update table without submitting the page, and how to change values of IG fields using JavaScript model.setValue?
Is there another way to do this? It doesn't have to be AJAX Callback.
Thank you in advance,
Regards,
Aleksandar Toprek