1
votes

I have an IG region where I disabled the toolbar and created my custom search item.

I want user to be able to type the first three characters of a name on the search item (named P8_SEARCH) and the IG report will only show the name(s) that starts with those 3 characters.

This should happen without clicking any button. The IG report query is shown below:

select member_id, first_name, last_name , address, dob, home_phone, cell_phone,
email_address from member_profile where first_name like '%'||:P8_SEARCH||'%';

I also created dynamic action with key release event and True action Execute JavaScript Code shown below:

var keyPressCount=0;

$("#P8_SEARCH").on("keypress", () => {
    if (keyPressCount < 2) {
        keyPressCount++;
    } else {
        $s("P8_SEARCH", apex.item( "P8_SEARCH" ).getValue());
    }
})

How can I achieve this without submitting the page? I will appreciate any suggestion. Example: SCREENSHOT OF IG

2

2 Answers

0
votes

Set an static_id for your IG region, in the dynamic action add apex.region("yourStaticId").refresh();to your JS code, this will refresh only the region. something like this:

var keyPressCount=0;

$("#P8_SEARCH").on("keypress", () => {
    if (keyPressCount < 2) {
        keyPressCount++;
    } else {
        $s("P8_SEARCH", apex.item( "P8_SEARCH" ).getValue());
        apex.region("yourStaticId").refresh();
    }
})
0
votes

If the search items are stored in an associated table, my idea is that you could associate a PL/SQL expression to execute using a Process. This process could be executed on a custom action.

Another idea is that you associate the dynamic action with a hidden button press, and make the JavaScript code click on the button. Then, you can 'simulate' the existence of a trigger for your dynamic action with key release event

What do you think?