Page 1 of 2

Form/browse problem after updating

Posted: Fri Sep 29, 2023 1:55 pm
by Keith-i
I have just updated to the latest release, which seems to have gone well but for one problem so far.

I have a browse/edit form which lists all the roads in my location. The related edit form drills down and shows information about properties on the chosen road. However, although the browse form opens ok and I can click on a road on the opening page, I cannot get to any subsequent pages by pressing the next page button nor can I perform a search by using the search box at the top of the browse form. In each instance I just end up with a blank screen with the field headers shown but no data and an egg-timer wheel.

The only debug info I get is [0]: with a header of

Code: Select all

nuDebug Results
2023-09-29 10:52:33 - <i>Before Browse</i> of Form <b>frm_salesbyroad</b> line 1 
Pressing F12 gives:

Code: Select all

Uncaught TypeError: document.getElementById(...) is null
    nuAddEditTabs http://192.168.1.114/rcsdb/core/nuform.js?ts=20230929122220:3484
    nuAddEditTabs http://192.168.1.114/rcsdb/core/nuform.js?ts=20230929122220:3483
    nuBuildForm http://192.168.1.114/rcsdb/core/nuform.js?ts=20230929122220:138
    successCallback http://192.168.1.114/rcsdb/core/nuajax.js?ts=20230929122220:131
    success http://192.168.1.114/rcsdb/core/nuajax.js?ts=20230929122220:15
    jQuery 4
I would appreciate any help possible to resolve this. It was working fine before the update.

Re: Form/browse problem after updating

Posted: Fri Sep 29, 2023 2:01 pm
by kev1n

Code: Select all

The error Uncaught TypeError: document.getElementById(...) is null typically occurs when you are trying to access an element in the DOM (Document Object Model) using document.getElementById(...), but the element with the specified ID does not exist on the page.
Are you using custom JavaScript code, and if so, could you share a glimpse of what it looks like?

Re: Form/browse problem after updating

Posted: Fri Sep 29, 2023 2:06 pm
by Keith-i
Hi Kev1n

I have this in the custom code JS 'browse' section

Code: Select all

// Exclude columns for searching
nuSetNoSearchColumns([1, 2, 3, 4]);

function nuSelectBrowse(e) {

    var roadID = $(e.target).attr('data-nu-primary-key');
    nuSetProperty('roadref', roadID, true)
    nuForm('63f8b8a29ec2a5c', '', '', '', '0');

    return false;
}

Re: Form/browse problem after updating

Posted: Fri Sep 29, 2023 2:20 pm
by kev1n
If you exclude the nuSetNoSearchColumns([1, 2, 3, 4]);, does the error persist?

Re: Form/browse problem after updating

Posted: Fri Sep 29, 2023 2:25 pm
by kev1n
It could also be that JavaScript of the form ID 63f8b8a29ec2a5c is causing the error.

Re: Form/browse problem after updating

Posted: Fri Sep 29, 2023 2:26 pm
by Keith-i
Removing nuSetNoSearchColumns that solves the problem. Interestingly I have other forms with nuSetNoSearchColumns which still work fine.
It could also be that JavaScript of the form ID 63f8b8a29ec2a5c is causing the error. wrote:
I don't have any JS on that form (at least I don't have any custom code)

Re: Form/browse problem after updating

Posted: Fri Sep 29, 2023 3:47 pm
by kev1n
Does the error occur when the first or second form is loaded?

Re: Form/browse problem after updating

Posted: Mon Oct 02, 2023 9:47 am
by Keith-i
Good morning Kev1n
The first form initially opens up and displays page 1 fine. It is when I try and navigate to page 2 or use the search box to find a specific record that the problem occurs. When I do this, the screen displays the column headers but no data.

Re: Form/browse problem after updating

Posted: Mon Oct 02, 2023 11:22 am
by kev1n
How many columns does your Browse form have? 1, 2, 3, 4 means that columns 2, 3, 4, 5 are excluded from the search because the index starts with 0 (= 1st column).

Re: Form/browse problem after updating

Posted: Mon Oct 02, 2023 12:30 pm
by Keith-i
Oops! I have 3 columns yet I now see my nuSetNoSearchColumns was expecting 5. I've just corrected it and it is now working fine. Thanks so much.

Odd that it all worked fine before I updated the nuBuilder files. I must have cloned a form and not changed that bit.