Ever got a customer request saying: “When i enter a number in this field i want to display the corresponding name over there as soon as i leave the field” ?
That’s the point where you tell your customer something about using a LOV instead or reloading the page or something else, because APEX lacks declarative AJAX functionality.
No Problem anymore, now you can use the new ApexLib Feature “AJAX Computations” which basically is a standard Computation for a page item with a new ApexLib Property “AJAX Computation”.
Check it out over here.
Seen it? Good, hope you like it. Here is what you need to do:
- declare a page item P70_EMPLOYEE_ID where user enters his number
- declare a page item P70_NAME where the corresponding name should be displayed
- declare a computation for page item P70_NAME, Type SQL Query: SELECT FIRST_NAME||’ ‘||LAST_NAME FROM EMPLOYEES WHERE EMPLOYEE_ID=:P70_EMPLOYEE_ID
- now go back to your computation and set the “Ajax Computation” checkbox in the Apexlib-Section (appears only if you use the BuilderPlugin , if you can’t or don’t want to use the BuilderPlugin write $APEXLIB_AJAX_COMPUTATION$ in the comment field)
ApexLib converts this checkbox at runtime to an AJAX Call which executes the computation whenever a reference page item is changed and writes the result to the page item.
You see, it is very easy to use, so use it and impress your customers or your boss !