Hello everyone,
I was able to implement parsley.js to do real time form validations and triggered the item validations via AJAX. I want to do the same the thing for Interactive Grid columns, however, I can't use pasrley.js for this because as a column loses focus the control item assigned to the column is not present anymore and so you can't get the value based static ID of the column since you just have a cell not an item.
The only way I have been able to run the column validations is passing the value in a page item, and send the value to session state via apex.server.process (pageItems), however, I would like these validations to also be executed when the user save the form and so those validations won't work in those cases since they are using the value of a page item :PXX_STYLE, instead of the column name :STYLE for example.
I set the column via PLSQL process to send it to session state and then I tried to looked into the AJAX request which is made of different things, but the interested part is below.
"regions": [
{
"id": "181142741955939611",
"ajaxIdentifier": "UkVHSU9OIFRZUEVXXXXXXXXXXXXXXXXXXXXXXX",
"ajaxColumns": "MTgxMTQyOTg2OTYxOTMXXXXXXXXXXXXXXXXXXX,
"reportId": "181910727548591997",
"view": "grid",
"**setSessionState": {**
**"values": [**
**{**
**"n": "STYLE",**
**"v": "DDDLKM"**
**}**
]
},
"allowedOperations": "SVVE/h1Tes3JEjsGutcigO5mLBnTJjkYtlY5XoRylX6IAEPEHf43j_O6WRpgP3JmaLAFZ7ghw8cDH7DWuzJDTktaTlQ"
}
]
There you can see the setSessionState which with the column name STYLE and the value DDDLKM. However, when I call item validations by query them via APEX_APPLICATION_PAGE_VAL view, the :STYLE bind variable for the column returns null and so that has been why I resorted to use an item which can be submitted to session state via apex.server.process.
I see something in apex.server.process and apex.server.plugin to pass that JSON in the pData parameter with something https://docs.oracle.com/en/database/oracle/apex/22.2/aexjs/apex.server.html#.process like:
{ "regions":
[{
"id": "<region-id-or-static-id>",
"other": "Other Properties"
}]
}
I would have expected that submitting the column to session state via PLSQL process would have been enough and the question is if indeed this is possible to send the information above in the same AJAX request that's calling and executing the validation for the column would work?
Maybe @john-snyders-oracle have some explanation or some examples up his sleeve. Of course, everyone is welcome to shed some light into this topic.
Thank you in advance.
Using APEX 22.2 with latest patch.
Ralph.