0
votes

I'm using Oracle APEX v4.2 with Oracle 11g R2 DB and IE11 browser.

I have a shuttle item within my page called P1_MY_SHUTTLE that has some values on the left based on a LOV query, which is all good.

What I also have is the ability to let the user enter their value from a separate text field (P1_MY_VALUE) with an "Add" button next to it.

So when the user enters their value and presses the "Add" button, I want this value to be added to the shuttle (right side).

I have a Dynamic Action click happening with the "Add" button that runs the following PL/SQL code:

  begin
  if :P1_MY_VALUE is null then
  :P1_MY_SHUTTLE := :P1_MY_VALUE;
  else
  :P1_MY_SHUTTLE := :P1_MY_SHUTTLE || ':' || :P1_MY_VALUE;
  end if;
  end;

Now, this all works fine as I have the values in session state but my problem is, I need to show these values within my P1_MY_SHUTTLE to the user each time they press the "Add" button.

Unfortunately I can't refresh the shuttle item using a DA Refresh as this doesn't work but if I perform a full page refresh (F5), the results in session are then displayed.

How can I show the results without performing a full page refresh? I basically need to show the values in session state after each click of the "Add" button.

1
Would you need these values in session state at all (before an actual page submit of course)? Are the display and return values of the LOV identical (I assume yes, since entries are directly added, but still. Adding a value where a display is expected or vice versa is odd behaviour)Tom
@Tom as long as I can get all the values for P1_MY_SHUTTLE inserted as individual records into a table for processing at page submit then session state is not required. LOV values are identical.tonyf

1 Answers

2
votes

Instead of "Execute PLSQL", use "Execute Javascript":

$("#P1_MY_SHUTTLE_RIGHT").append("<option value='"+$v("P1_MY_VALUE")+"'>"+$v("P1_MY_VALUE")+"</option>");

This will append an extra option in the select list used for the right hand display of the shuttle.