Search code examples
javascriptoracle-databaseplsqloracle-apex

Oracle Apex - Is it possible to send a value from a page item from the client side to the server side without a submit?


I added a JavaScript function to capture the ROWID of the rows that are selected in the GRID and passed it to a page item.

var gridView = apex.region("emp").call("getCurrentView"),
    selectedRecords = gridView.getSelectedRecords(),
    idValues = "";

for (var i = 0; i < selectedRecords.length; i++) {
    var record = selectedRecords[i];
    var idValue = record[0];
    idValues += idValue;

    if (i < selectedRecords.length - 1) {
        idValues += ",";
    }
}
$s("P43_ROW_SELECT", idValues);

However, I need to use the values ​​that this item receives in a process (server side), so I have to submit the page first so that the item actually receives the values, so that I can use them in the process.

My question, if it is possible to pass the values ​​that the item receives in my process in PL/SQl (server side), without the need to submit the page, is there another way besides submitting?


Solution

  • Thanks for the help, I did it differently, instead of passing it to a page item, I passed it as a parameter in the process call, something like this:

    apex.server.process( "processSubmitAjax", {
        x01: idValues 
    },
    {
       [...]
    }
    

    And I called in the process

    DECLARE
      l_x01         VARCHAR2(100);
    BEGIN
      l_x01 := APEX_APPLICATION.G_X01;
    
    [...]