nuSearchAction: Uncaught TypeError

Questions related to using nuBuilder Forte.

nuSearchAction: Uncaught TypeError

Postby kev1n » Mon Sep 14, 2020 2:05 pm

Hi Steven,

nuSearchAction() can produce an "Uncaught TypeError: Cannot read property 'name' of null" if it's called from a Procedure or a Custom Code.

nuSearchAction.png
nuSearchAction.png (17.73 KiB) Viewed 30 times



Fix:

Code: Select all
function nuSearchAction(S, F){

   if(arguments.length > 0){
      $('#nuSearchField').val(S);
   }
   if(arguments.length == 2){
      $('#nuFilter').val(F);
   }

   var s   = String($('#nuSearchField').val()).replaceAll("'","'", true);
   var f   = String($('#nuFilter').val()).replaceAll("'","'", true);
   
   window.nuFORM.setProperty('search', s);
   window.nuFORM.setProperty('filter', f);
   
   var c = arguments.callee.caller === null ? '' :  arguments.callee.caller.name;
   if(arguments.length === 0 && c != 'nuGetPage'){
      window.nuFORM.setProperty('page_number', 0);
   }
   if(arguments.length >= 1){
      window.nuFORM.setProperty('page_number', 0);
   }

   nuGetBreadcrumb();
   
}
kev1n
 
Posts: 969
Joined: Mon Oct 15, 2018 2:13 am

Re: nuSearchAction: Uncaught TypeError

Postby admin » Thu Sep 17, 2020 10:48 am

kev1n,

That's done now.

Thanks


Steven
admin
Site Admin
 
Posts: 3348
Joined: Mon Jun 15, 2009 9:53 am


Return to General



cron