If you copy it with PL/SQL then you're setting it in Session State, which is back at the server and not on the loaded browser screen.
Try using a Dynamic Action on your button with a "Set Value" action.
Thanks for the reply, but I don't fully understand, sorry. The PL/SQL code on my button calls a procedure to get the values from the previous record and assign them to the page items. All the other items then show their new values on screen, but the modal LOV goes blank, even though the new value has been assigned. I assume it is because this item is a LOV, rather than a text item?
I am facing the same problem. I used the Modal LOV on modal region. There was the standard popup LOV before - everything went correct. Even if i replaced existing standard LOV with LOV plugin.
I use this plugin in normal forms and it works good. But i have a empty item only in here.
1) In my previous assignation for the item i use (no plugin):
after modal region is opened. (it works OK)
2) If i use the plugin: the item value is null (value="").
3) If i use for value assignation jQuery:
assignation is done (value is shown) but the item seem like empty if validation of item occur. (if i press the submit button on modal window it throws "Empty item value")
It is strange...
EDIT: I used jQuery selector for set and get value (when compare to existing records in AJAX call)
$('#ITEM_NAME').val('value'); or $('#ITEM_NAME').val();
It works now.
It will help to you, maybe.
Copy values from a previous record to the current one? Could you set up an example on apex.oracle.com?
The problem you're running into has to do with the fact that there are two values involved: display and return. When you use $s as you are it only sets the return value and the display value is set to NULL. Try this:
$s('PX_ITEM_NAME', 'returnvalue', 'displayvalue');
Another thing you could do is to leverage the setValuesByReturn method. The idea is to pass the return value and the method will do a lookup and if it finds a single match it will set the display and return values. Because I had to include a custom version of jQuery calling the method is a little strange:
It works as you wrote. (i used the first solution)
Working for me too using solution 1. Many thanks Dan (and J).