This topic is locked

Pages per record

7/6/2007 11:19:10 AM
PHPRunner General questions
C
ccuser author

Hi,
I have a list that shows 20 records per page but then I use the function "BeforeProcessRowList" and return false to not display many of the records. That work's fine but the numbering of records returned on the bottom does not reflect the new "processed" record count; it shows the total records before processing.
Is there a way to reset the record/page counter after the BeforeProcessRowList function is completed? Preferably, I would like to know if this to be done in one of the event functions rather than the code that codes rewrittern on each build.
Thanks for all your help!

Sergey Kornilov admin 7/6/2007

Good point - we need to think how to handle records count in this case.
Frankly saying, the number of pages is also incorrect if you hide some rows as it's calculated based on original records per page count.

Not really sure what is the best approach here.

C
ccuser author 7/6/2007

The only way I can think of to work around this was if there were a way to edit the sql query on page load so you can filter the results by a where statement. Then since the pagination function is called after $strsql is executed the row count would be correct.
But I have not found a way to to edit $strSQL and make it get executed. Maybe its not possible?
Any idea if this issue will be resolved in the next release that's coming up?
Thanks again

Sergey Kornilov admin 7/6/2007

We'll have this option in the next update (in two weeks).

C
ccuser author 7/16/2007

Curious to know if this timeline is still valid?

We'll have this option in the next update (in two weeks).

A
alang 9/6/2007

I am also having problems with this issue (using build 297). I have set the list page to return potentially hundreds of records at 20/page. Based on a parameter passed in the call to display the page I want to be able to select a subset of records to display on the list page (potentially around 5% of the total returned by the basic SQL statement. I have access to the SQL string in the "BeforeQueryList" event but cannot use that because the information used to "screen" the records has come from another database. I then select which records to display by returning true/false in the "BeforeProcessRowList" event.
Problems are:

  1. Only 2 records display on the first page (pagination appears to be using the original complete set)
  2. When I click on any other page I get a PHP error
    My current workaround is to set the number of records per page to a large number.

A
alang 9/9/2007

Sorry - please ignore #2 (PHP error) in my last post - that was being caused by another problem.

Sergey Kornilov admin 9/10/2007

I'm afraid I miss the question.
Please rephrase.

A
alang 9/10/2007

Sorry - As an example, I have a list page that would normally return 400 records. If I have the records per page set to 20, I get 20 records on each of 20 pages as expected. If I then add code to the "Before Record Processed" event such that it returns TRUE for 1 in every 10 records and FALSE for the others, I end up with 20 pages with only 2 records displayed on each page. I would prefer/expect to see 2 pages with 20 records on each page.