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.
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
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?
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.