0
votes

In my javascript I am setting page item:

apex.item("P2_TAB").setValue($tabVal);
apex.server.process ( "SAVE_HIDDEN_VALUE_IN_SESSION_STATE", 
 {
      x01: $tabVal,
      pageItems: "P2_TAB"
  }, 
  {dataType: 'text'} );

The value of P2_TAB gets set but when I view session, P2_TAB does not show up. In Affected Elements I selected Item(s) and P2_TAB. What am I doing wrong?

1
The documented example includes the hash prefix on "#P2_TAB" docs.oracle.com/en/database/oracle/application-express/18.2/… - Scott

1 Answers

1
votes

This works here:

apex.item('P2_TAB').setValue($tabVal);
apex.server.process('DUMMY', {pageItems: '#P2_TAB'}, {dataType: 'text'});

If you do this frequently in your application, maybe is useful to create a function like

setValueInSession(itemName, itemValue)