make the page work with the automatic row fetch first
set the Submit when Enter pressed = yes for Pxx_EMPNO
if you enter a valid empno and press enter, page will fetch the record.
if you enter a invalid empno and press enter, 'No data found' error, better validate the EMPNO in a validation after submit.
thanks for your answer!
But what I want to do is to automatically refresh a form as soon as I enter a valid empno (maybe with autocomplete included), WITHOUT hitting enter.
how to you define 'refresh a form as soon as I enter a valid empno'? when you tab out or click out of the field?
if yes, add dynamic action to Pxx_EMPNO on change submit page
otherwise, if you want the page to refresh as you type, use dynamic action/ajax to validate the input against DB records onkeypress, if exists, submit page
But submitting means that the page must be reloaded again?
So it's like clicking on enter?
I think it was in a form in MS Access where you just entered last and first name, and as soon as you clicked out of the field, it auto-filled the rest of the field.
Guess it's not possible?
If you do not want it to resubmit... You can use DA, that executes PL/SQL code, with code like "select yyyy into : PXX_ITEM" for instance...
To trigger this DA, you can either way set it up through the DA, or you could set it to be "CUSTOM" event, and by pressing that fetch, make it execute a jscript that would do a $.event.trigger("Custom_name");
That should do it to avoid the submission... if that is what you want.
Hey, nice idea!
I'd trigger it through the DA I think.
But does the PL/SQL code / the SELECT INTO query really fill in the empty form fields - without submitting the page again?
Because I thought that this PL/SQL command only inserts the needed values into session variables and that after a page submit/reload, the items are filled with the session variables?
You will have to put a full block:
--variables if any
But that should do the trick.
DA does submit your code, but not in the reload way you think
DA can communicate with your DB without refreshing the page, but items do get submited, in the pl/sql code option, it asks you to submit the items you will be using inside your code... you just simply enumerate them... the DA does the rest.
Think of DA as AJAX code... to get the idea.
can you start at the begining.... how do I make a form do "automatic row fetch" -- where do I get that process?
UPDATE: found out how to make an Automatic Row Fetch Process
- still haven't figured out how to trigger it.
created a dynamic action to submit page on change but page does not fill in with fetched data?
I found some time today to test it - and it works like a charm
But one last question: If I use this dynamic action (which can also be fired at page load), do I still need a supplementary Automatic Row Fetch Process?
It would have been great to trigger the ARF process at page load + when I change the primary key item value (= no PL/SQL code writing necessary), but it's unnecessary to use ARF + custom code?
I am attempting to replicate this approach
I tirgger with a mouse click
I can see the pinwheel of the dynamic action running but nothing displays
select ename, job into
from emp e
where :p16_empno = e.empno;
Did you also enter the field names in "Page Items to submit + to return"?
Hey Jules, sorry the delay.... I've been busy on other issues as well hehe
Well, if you are populating everything on the DA, you do not need the row fetch, since it only executes when the page loads, after that.... every dynamic action will not trigger it.
But if for some reason you want to keep it for when page is loaded, I don't think it will be a problem.
thanks for your answer, helped me a lot!