Valuelist not refreshing on value change

Forum to discuss the new web client version of Servoy.

Valuelist not refreshing on value change

Postby bhavesh.panchal » Wed Feb 28, 2018 11:37 am

Hello,
we are using dropdown devex component, where we are facing an issue.

There is "valuelist" property same as servoy dropdown component. Now by default 500 records are coming and there is few more records even after and so when we type then data should be come which is actually after 500, like happening in servoy dropdown but not happening for our component. So can you please guide that what needs to be trigger or call any event/API to achieve it?

Thanks
Bhavesh
bhavesh.panchal
 
Posts: 3
Joined: Wed Feb 28, 2018 11:13 am

Re: Valuelist not refreshing on value change

Postby rafig » Wed Feb 28, 2018 12:23 pm

Hi,
easiest thing to do is to load valuelist yourself using SQL before displaying dropdown. (Servoy dynamic loading is limited to 500 values & only shows others when set to 'typeahead')
If values don't change often, do it in onSolutionOpen
If they do, do it in 'onShow' of form

something like
Code: Select all
   var query1 = "SELECT description FROM stock WHERE archived = 0 AND item_number IS NOT NULL ORDER BY item_number";
   var dataset1 = databaseManager.getDataSetByQuery ( server_name, query1, null, 10000 );

   var displayDataArray = dataset1.getColumnAsArray ( 1 );
   var query2 = "SELECT stockid FROM stock WHERE archived = 0 AND item_number IS NOT NULL ORDER BY item_number";

   var dataset2 = databaseManager.getDataSetByQuery ( server_name, query2, null, 10000 );

   var realDataArray = dataset2.getColumnAsArray ( 1 );
   application.setValueListItems ( 'valuelistname', displayDataArray, realDataArray );

if you only need display values, just use one query and parameter

Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 497
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Valuelist not refreshing on value change

Postby jdbruijn » Wed Feb 28, 2018 12:38 pm

rafig wrote:Hi,
easiest thing to do is to load valuelist yourself using SQL before displaying dropdown. (Servoy dynamic loading is limited to 500 values & only shows others when set to 'typeahead')
If values don't change often, do it in onSolutionOpen
If they do, do it in 'onShow' of form

something like
Code: Select all
   var query1 = "SELECT description FROM stock WHERE archived = 0 AND item_number IS NOT NULL ORDER BY item_number";
   var dataset1 = databaseManager.getDataSetByQuery ( server_name, query1, null, 10000 );

   var displayDataArray = dataset1.getColumnAsArray ( 1 );
   var query2 = "SELECT stockid FROM stock WHERE archived = 0 AND item_number IS NOT NULL ORDER BY item_number";

   var dataset2 = databaseManager.getDataSetByQuery ( server_name, query2, null, 10000 );

   var realDataArray = dataset2.getColumnAsArray ( 1 );
   application.setValueListItems ( 'valuelistname', displayDataArray, realDataArray );

if you only need display values, just use one query and parameter

Rafi

Better to do it in one query:

Code: Select all
   var query1 = "SELECT stockid, description FROM stock WHERE archived = 0 AND item_number IS NOT NULL ORDER BY item_number";
   var dataset1 = databaseManager.getDataSetByQuery ( server_name, query1, null, 10000 );

   var realDataArray = dataset1.getColumnAsArray ( 1 );
   var displayDataArray = dataset1.getColumnAsArray ( 2 );
Jos de Bruijn
Welcome CCS
Servoy Certified Developer
Image
jdbruijn
 
Posts: 465
Joined: Sun Apr 11, 2010 6:34 pm

Re: Valuelist not refreshing on value change

Postby rafig » Wed Feb 28, 2018 12:43 pm

jdbruijn wrote:Better to do it in one query:

Good point, I was quickly copying from an old solution, not how I'd do it now of course ;-)
Servoy Certified Developer
Image
rafig
 
Posts: 497
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Valuelist not refreshing on value change

Postby bhavesh.panchal » Wed Feb 28, 2018 4:09 pm

Thanks for your feedback.

But thing is that we are using and pointing direct database table.
And same approach we are using thoroughly in our application mostly. So what to do now can you please suggest?

Thanks,
Bhavesh
bhavesh.panchal
 
Posts: 3
Joined: Wed Feb 28, 2018 11:13 am

Re: Valuelist not refreshing on value change

Postby jdbruijn » Thu Mar 01, 2018 10:17 am

If you are using your own component here, I think you will have to take care of loading the next block of records your self, I am not sure how to do.
Maybe someone from Servoy can answer this better for you.
Jos de Bruijn
Welcome CCS
Servoy Certified Developer
Image
jdbruijn
 
Posts: 465
Joined: Sun Apr 11, 2010 6:34 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 3 guests