Forum Stats

  • 3,767,858 Users
  • 2,252,726 Discussions
  • 7,874,366 Comments

Discussions

Popup LOV Error - Uncaught TypeError: Cannot read property 'length' of null

User_BM3HY
User_BM3HY Member Posts: 2 Green Ribbon

I am using APEX version 20.2.0.00.20 against an Oracle 19c database.

I have a popup LOV that throws an error if I try to change the sort order. The list of values for the LOV is of type Shared Component and uses a list of values that includes additional display columns. It is set to display as a modal dialog with initial fetch set to On User Request.

The error occurs when I try to change the sort order by clicking in one of the column headers. It doesn't matter if I've searched for anything yet or not.

If I change the initial fetch attribute of the LOV to Automatic, the error does not occur.

I have created a demo application where this behavior can be observed here:

https://apex.oracle.com/pls/apex/one_todd_space/r/popup-lov-test1/home?session=3871025995530

The problem appears to be in the T function of desktop_all.min.js?v=20.2.0.00.20

This is what I see in the inspector:

Uncaught TypeError: Cannot read property 'length' of null

  at T (desktop_all.min.js?v=20.2.0.00.20:19)

  at HTMLDivElement.sortChange (desktop_all.min.js?v=20.2.0.00.20:19)

  at a.<computed>.<computed>._trigger (desktop_all.min.js?v=20.2.0.00.20:28)

  at a.<computed>.<computed>._sortChange (interactiveGrid.min.js?v=20.2.0.00.20:7)

  at a.<computed>.<computed>._sortChange (desktop_all.min.js?v=20.2.0.00.20:28)

  at HTMLButtonElement.<anonymous> (interactiveGrid.min.js?v=20.2.0.00.20:7)

  at HTMLDivElement.dispatch (desktop_all.min.js?v=20.2.0.00.20:2)

  at HTMLDivElement.v.handle (desktop_all.min.js?v=20.2.0.00.20:2)


HTMLDivElement.sortChange is calling the T function like this: T(A, null, t.column.property, t.direction)


The function T reads:

function T(e, o, n, a) {

      var i, s = !1, c = !1, h = l.getOption("fetchData");

      e.forceRefresh && (s = !0,

      "none" !== r.initialFetch || e.typeAhead && O || (c = !0),

      h.search = null,

      e.forceRefresh = !1),

      null !== o && o !== h.search && (h.search = o,

      s = !0),

      n && a && (n !== h.sortColumn || a !== h.sortDirection) && (h.sortColumn = n,

      h.sortDirection = a,

      s = !0),

      s && (i = t.escapeRegExp(h.search).replace(/[_%]/g, (function(e) {

        return "[^<>&]" + ("%" === e ? "*" : "")

      }

      )),

      u.options.highlighterContext = {

        term: h.search,

        re: new RegExp("([<>&;])|(" + i + ")","ig")

      },

      _ ? o.length >= r.minSearchChars && !c && !e.typeAhead ? (u._setOption("noDataMessage", P),

      l.clearData()) : (u._setOption("noDataMessage", _),

      l.setData([]),

      h.search = null) : e.typeAhead && !O ? (l.setData([]),

      h.search = null) : l.clearData(),

      e.typeAhead = !1)

    }

and the error is raised at this line: _ ? o.length >= r.minSearchChars && !c && !e.typeAhead ? (u._setOption("noDataMessage", P)


I can see that HTMLDivElement.sortChange is passing null to o, so the error makes sense but I have no idea how to control what gets passed to o. I have several applications that use popup LOVs this way and they all error this way.

Is this a known bug?

Tagged: