Go Back   SmartClient Forums > Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 1st Aug 2011, 01:29
lkuchars lkuchars is offline
Registered Developer
 
Join Date: Apr 2010
Posts: 18
Default Progressive loading - how to

Hi there,

I'm creating this thread hoping to aggregate info on this in one place. Information regarding this issue is scattered all over the forum but there is no single thread which says how to do it while retaining functionality available in SqlDataSource (sorting, filtering etc)

Client side documentation regarding ResultSet states that there is nothing to be done clientside to implement this. You just have to return totalRows > endRow on the server.

What if I want to use SQLDataSource and all its built in functionality (no custom queries etc.) but skip the phase where SQLDataSource sets totalRows on response. I know SQLDataSource may compute this value in many ways (resultSet scroll, LIMIT statement etc.) depending on database, driver etc.

Is there any way I can disable built in counting and provide totalRows computed manually?

lkc
Reply With Quote
  #2  
Old 4th Aug 2011, 03:49
mpretorian mpretorian is offline
Registered Developer
 
Join Date: Mar 2011
Posts: 133
Default

Use the attribute "skipRowCount" on the operationBinding like here:
Code:
<operationBinding operationType="fetch" serverMethod="fetch" skipRowCount="true" >
And set manually the total rows in the DMI fetch operation like here:
Code:
        // in case the total rows was not calculated because a count sql was not performed
        // we use the "progressive" loading approach
        dsResponse.setTotalRows(
                dsResponse.getEndRow() < dsRequest.getEndRow() ? // actual response contains more or less rows then requested ? 
                dsResponse.getEndRow()  // less rows
                :  dsRequest.getEndRow() + 2*(dsRequest.getEndRow() - dsRequest.getStartRow()) // more or equal number of rows - then return the actual number of rows plus 2 size of the page
                );
Reply With Quote
  #3  
Old 4th Apr 2012, 07:26
claudiobosticco claudiobosticco is offline
Registered Developer
 
Join Date: Sep 2008
Posts: 544
Default

SC_SNAPSHOT-2012-03-20_v8.2p/PowerEdition

I'm trying this exact approach, but in the server logs there's this INFO:
Code:
=== 2012-04-04 17:22:46,922 [c-64] INFO  SQLDataSource - [builtinApplication.SERVIZI_fetch] Skipping row count query - Row count will be obtained by traversing the entire dataset
and actually it traverse the entire dataset. Why? I've also disabled sorting on the grid.
Reply With Quote
  #4  
Old 4th Apr 2012, 07:30
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 37,100
Default

progressiveLoading is now built in - see operationBinding.progessiveLoading.
Reply With Quote
  #5  
Old 4th Apr 2012, 23:22
claudiobosticco claudiobosticco is offline
Registered Developer
 
Join Date: Sep 2008
Posts: 544
Default

I see it's a 8.3d feature...I'll try it.
I want to use it as a workaround for this problem I have with distinct http://forums.smartclient.com/showthread.php?t=17947
where the select count(*) returns a number of rows which is different from the actual select distinct
Reply With Quote
  #6  
Old 5th Apr 2012, 05:53
claudiobosticco claudiobosticco is offline
Registered Developer
 
Join Date: Sep 2008
Posts: 544
Default

found a bug which blocks me migrating to 8.3:
http://forums.smartclient.com/showpost.php?p=84237&postcount=1
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading prompt of grid: modalmask on loading grid, center of prompt martintaal Technical Q&A 9 20th May 2011 05:58
Grouping with Progressive loading satyag Smart GWT Technical Q&A 0 1st Oct 2009 22:56
loading indicator at the startup of ShowCase jasonzhang2002 Smart GWT Technical Q&A 5 29th May 2009 21:03
Lazy Rendering vs Lazy Loading hgaglani Smart GWT Technical Q&A 5 7th Apr 2009 08:10
Loading data.. message does not dissappear during ListGrid fetchData mahen Technical Q&A 4 13th Nov 2007 10:00

© 2010,2011 Isomorphic Software. All Rights Reserved