Coding Duchess
Coding Duchess

Reputation: 6909

Oracle APEX cannot set the session of a page item set via javascript

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?

Upvotes: 0

Views: 841

Answers (1)

romeuBraga
romeuBraga

Reputation: 2165

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)

Upvotes: 1

Related Questions