Page 2 of 2

Re: Browse Screen: No search results

PostPosted: Fri Sep 11, 2020 2:08 pm
by kev1n
If you change this

Code: Select all
   if(arguments.length == 0){
      window.nuFORM.setProperty('page_number', 0);
   }


... to this

Code: Select all
   if(arguments.length >= 1){
      window.nuFORM.setProperty('page_number', 0);
   }


it works fine even when 2 parameters are passed to nuSearchAction().

Please also test it.

Re: Browse Screen: No search results

PostPosted: Wed Sep 23, 2020 12:18 am
by gerese
Hi Steven,

With the version published on Sourceforge from 11.09.2020, the search in browseform worked ... with some issue when using nuSearchAction() second parameter .

After update published on 17.09.2020, I have problem with forward / backward scrolling , it always remains on page 1 without anything moving (on form with object, translate, forms ... ).

I applied Kevin's fix https://github.com/smalos/nuBuilder4-Bug-Tracker/blob/master/20200826_browse_no_results.md
and it works now.



PS.: 9-11 ... is not a good day for projects, go away :lol:

Re: Browse Screen: No search results

PostPosted: Tue Sep 29, 2020 9:04 am
by admin
Everyone,

That's done, Thanks.


Steven

Re: Browse Screen: No search results

PostPosted: Sat Oct 17, 2020 1:46 am
by benritter
Hi, think my issue is related to this string. I have a a browse form and it's subform browse both running in iframes on the same page.
looks like this:
Screenshot 2020-10-16 120659.png
Screenshot 2020-10-16 120659.png (30.94 KiB) Viewed 52 times


The subform search function works fine. But the main browse form search only highlights the matching rows. like this:
Screenshot 2020-10-16 120757.png
Screenshot 2020-10-16 120757.png (24.47 KiB) Viewed 52 times


How can I make the main browse search behave the same as the subform search?
Thanks!

Re: Browse Screen: No search results

PostPosted: Sat Oct 17, 2020 3:59 pm
by kev1n
Please show us your SQL.
And enter
Code: Select all
nuCurrentProperties().browse_sql
in the developer console to view the generated sql after performing a search.
(also see here: viewtopic.php?f=19&t=9875&p=19114&hilit=nuCurrentProperties+browse_sql#p19114)

Re: Browse Screen: No search results

PostPosted: Tue Oct 20, 2020 12:26 am
by benritter
When the browse is displayed in an iframe, In the console, nuCurrentProperties() .browse_sql returns "null".

When I open the same browse edit form with a button in a new bread crumb, the console nuCurrentProperties() .browse_sql returns this (222 was the search criteria):

SELECT client_id,first_name,last_name,street_address,city,zipcode,cell,home,work,car,food,diapers,diaper_size,wipes,formula,hygiene,client_number
FROM client
WHERE 1; AND ( (CONVERT(first_name USING utf8) LIKE "%222%" OR CONVERT(last_name USING utf8) LIKE "%222%" OR CONVERT(street_address USING utf8) LIKE "%222%" OR CONVERT(city USING utf8) LIKE "%222%" OR CONVERT(zipcode USING utf8) LIKE "%222%" OR CONVERT(cell USING utf8) LIKE "%222%" OR CONVERT(home USING utf8) LIKE "%222%" OR CONVERT(work USING utf8) LIKE "%222%" OR CONVERT(car USING utf8) LIKE "%222%" OR CONVERT(food USING utf8) LIKE "%222%" OR CONVERT(diapers USING utf8) LIKE "%222%" OR CONVERT(diaper_size USING utf8) LIKE "%222%" OR CONVERT(wipes USING utf8) LIKE "%222%" OR CONVERT(formula USING utf8) LIKE "%222%" OR CONVERT(hygiene USING utf8) LIKE "%222%" OR CONVERT(client_number USING utf8) LIKE "%222%") )



Browse SQL for the main form is
SELECT * FROM client WHERE 1;

Browse SQL for subform is

SELECT
*
FROM
(
SELECT
household.*,
client.client_number
FROM
household
LEFT JOIN client ON household.client_id = client.client_id
) T

Re: Browse Screen: No search results

PostPosted: Tue Oct 20, 2020 1:02 am
by kev1n
benritter wrote:When the browse is displayed in an iframe, In the console, nuCurrentProperties() .browse_sql returns "null".



Did you switch to the corresponding context (iframe) before entering nuCurrentProperties().browse_sql ?
"Top" is the default (main form), select the "iframe" context.

Re: Browse Screen: No search results

PostPosted: Tue Oct 20, 2020 2:34 am
by benritter
Thanks, that is good to know about switching context. And now I can see the results from the browse in the iframe.
BUT, (AAAARRRRGH!) The problem was that, in my browse sql, I ended my query with ";" like a good boy. But then, the sql generated by the search function was all placed after the ";". I deleted the ";" from my sql. problem solved. And I thought I had tried that already.
Thanks for the help!