Paging of a weblistbox

  1. 7 months ago

    Trevor C

    21 Apr 2017 Melbourne, Australia

    I have a weblistbox that at the moment has about 20000 rows. I'm wondering how I could get it to only load 100 rows at a time. And if I click a button load the next 100 rows.....

    I used OFFSET and LIMIT and have two buttons "PREV" and "NEXT" and it works really well for me..

  2. Christian S

    21 Apr 2017 Pre-Release Testers, Xojo Pro Germany

    we did before in a project to load in a timer regularly a few more rows.

    So when user enters search term, we could do query and just add 50 rows.
    Keep the recordset in a property, run timer every few milliseconds and add 50 more rows.

    This way list fills instantly and may load thousands of rows over time.

  3. David C

    21 Apr 2017 Pre-Release Testers, Xojo Pro Derby, ITM

    In SQL use the OFFSET command and keep a variable of where you're up to with the current offset.

  4. Tobias B

    21 Apr 2017 Pre-Release Testers, Xojo Pro Bern, Switzerland

    @David C In SQL use the OFFSET command and keep a variable of where you're up to with the current offset.

    or better: don't :) For an explanation why and what to use instead see here: http://use-the-index-luke.com/no-offset

  5. Christian S

    21 Apr 2017 Pre-Release Testers, Xojo Pro Germany

    Thanks. Great article about why not to use offset.

  6. Michel B

    21 Apr 2017 Pre-Release Testers, Xojo Pro
    Edited 7 months ago

    @Trevor C I have a weblistbox that at the moment has about 20000 rows. I'm wondering how I could get it to only load 100 rows at a time. And if I click a button load the next 100 rows.....

    How are you loading the weblistbox ?

    A frequent solution is to load the content into an array, then load the webListBox from the array.

  7. Christian S

    21 Apr 2017 Pre-Release Testers, Xojo Pro Germany

    I think the query in a timer to load the next 50 rows based on ID column > Last fetched ID could be good.

    Extra arrays are not needed then.

  8. Kenneth L

    21 Apr 2017 Pre-Release Testers, Xojo Pro Answer Bermuda Run, NC

    I used OFFSET and LIMIT and have two buttons "PREV" and "NEXT" and it works really well for me..

  9. Bob K

    21 Apr 2017 Pre-Release Testers, Xojo Pro Kansas City

    We use the Offset and Limit commands and have a 'paging' control. You set what your MaxRows limit is and the paging control shows you something like this: << 1 2 3 4 5 6 >> . User presses a page number and it reloads the listbox with that page of data.

    If you want to learn how do this you can get this as part of our subscription video training at http://xojo.bkeeney.com/XojoTraining/ . Over 200 videos, 65+ hours, and most projects come with source you can use in your own project.

  10. scott b

    21 Apr 2017 Pre-Release Testers, Xojo Pro local coffee shop

    @Bob K If you want to learn how do this you can get this as part of our subscription video training at http://xojo.bkeeney.com/XojoTraining/ . Over 200 videos, 65+ hours, and most projects come with source you can use in your own project.

    I have watched many of the videos and have learned a lot from them. I would recommend them to anyone writing Xojo code.

  11. Trevor C

    21 Apr 2017 Melbourne, Australia
    Edited 7 months ago

    Thanks guys.

    I have enough info now to move forward.

    And I might look into @Bob K training.

or Sign Up to reply!