Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

APEX set item value & session state with javascript

I am trying to set the value and the session state with Javascript in oracle apex. Here my function that I call:

function setItemValue(node) {
    $s('P2020_SELECTED', node);

    apex.server.process ('MY_PROCESS', {
         p_arg_name: 'P2020_SELECTED',
         p_arg_value: node
      });
    } 

The display value (Line 2) will be set but the session state not. I get this error on page load in apex.

Error: SyntaxError: Unexpected token P in JSON at position 0
like image 708
Markus Avatar asked Jun 25 '26 23:06

Markus


1 Answers

Try this:

function setItemValue(node) {
  $s('P2020_SELECTED', node);              
  apex.server.process('MY_PROCESS',{
    pageItems: '#P2020_SELECTED'
  },{dataType: "text"});
} 
like image 151
Madona Avatar answered Jun 28 '26 13:06

Madona



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!