Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Form/browse problem after updating

Questions related to using nuBuilder Forte.
Keith-i
Posts: 88
Joined: Wed Jan 18, 2023 3:03 pm
Has thanked: 1 time
Been thanked: 1 time

Form/browse problem after updating

Unread post 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.
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Form/browse problem after updating

Unread post 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?
Keith-i
Posts: 88
Joined: Wed Jan 18, 2023 3:03 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Form/browse problem after updating

Unread post 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;
}
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Form/browse problem after updating

Unread post by kev1n »

If you exclude the nuSetNoSearchColumns([1, 2, 3, 4]);, does the error persist?
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Form/browse problem after updating

Unread post by kev1n »

It could also be that JavaScript of the form ID 63f8b8a29ec2a5c is causing the error.
Keith-i
Posts: 88
Joined: Wed Jan 18, 2023 3:03 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Form/browse problem after updating

Unread post 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)
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Form/browse problem after updating

Unread post by kev1n »

Does the error occur when the first or second form is loaded?
Keith-i
Posts: 88
Joined: Wed Jan 18, 2023 3:03 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Form/browse problem after updating

Unread post 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.
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Form/browse problem after updating

Unread post 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).
Keith-i
Posts: 88
Joined: Wed Jan 18, 2023 3:03 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Form/browse problem after updating

Unread post 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.
Post Reply