Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sorting a Popup LOV at Runtime

Jared C5 days ago

Oracle APEX 24.1.6

I have an Inline Popup LOV. The actual list of values populating it is quite large, so I set the property Minimum Characters to “2” for this Popup LOV. The user was then asking me about sorting the LOV at runtime, and I noticed I was unable to… Whenever I click the sorting glyphs on the Popup LOV column headers, I get a client-side error:

Uncaught TypeError: Cannot read properties of null (reading 'length')
    at refresh (widget.util.js?v=24.1.6:2440:33)
    at HTMLDivElement.sortChange (widget.util.js?v=24.1.6:2850:29)
    at $.<computed>.<computed>._trigger (jquery-ui-apex.js?v=24.1.6:979:13)
    at $.<computed>.<computed>._sortChange (widget.grid.js?v=24.1.6:7877:22)
    at $.<computed>.<computed>._sortChange (jquery-ui-apex.js?v=24.1.6:405:25)
    at HTMLButtonElement.<anonymous> (widget.grid.js?v=24.1.6:4724:22)
    at HTMLDivElement.dispatch (jquery-3.6.4.js?v=24.1.6:5466:27)
    at elemData.handle (jquery-3.6.4.js?v=24.1.6:5270:28)

Googling around, I saw that the issue is related to having a non-zero value for the property Minimum Characters, as described in this post.

I played around with my example, and it seems it may also be related to the property Initial Fetch being set to “Automatic” vs. “On User Request”. I noted that when Minimum Characters is “0” and Initial Fetch is “Automatic” then I can sort the columns in the Popup LOV at runtime.

First, I would like to be able to sort at runtime while still having the results be user driven because it is a large list of values that can slow down page rendering / processing. Is this possible?

The other issue I am running into is the sorting order. In a nutshell, we will get results like this:

And what we would like is for the Popup to list all the projects that start with “Bug” first, and then list the Projects that contain “Bug” subsequently, in alphabetical order. oracleapex.com is on the latest Oracle APEX version (24.2.8) and I noticed that there is a property for the LOV called Match Type. If I set it to “Starts With” then I get the results that start with “Bug” first, but I don't get any other results at all. And then the version of APEX that I am on (24.1.6) doesn't seem to have this option anyway.

So secondly, is there a way to sort the results of the Popup LOV such that the “main” searchable column (in this case, the Project column) shows results by whatever starts with the search term and subsequently by whatever contains the search term (in alphabetical order)?

(There is a caveat to this in that if other columns are searchable, those could show up first as well if the content of those columns matches the search term “better” although I'm still determining if that's limited to an exact match or other kinds of matches as well. For now, we'll presume we have one, relevant searchable column, and if there are other columns present, they are there for confirmation / display purposes only.)

This post has been answered by Karel Ekema on Sep 25 2025
Jump to Answer
Comments
Post Details
Added 5 days ago
6 comments
133 views