NetTalk Central

Author Topic: Pagination and reseting a browse  (Read 4656 times)

sylvain

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Pagination and reseting a browse
« on: October 19, 2010, 05:27:01 AM »
Hi,
I have 2 questions here.
First, in a browse, I would like to put page x/y at the top. I know the number of records and I also know the number of records by page. Is there a session variable that I can test indicating that the end user has pressed the next, previous, first or last button ? If not, is there an embed point where I can test that (I did'nt found anything in the web handler)
Second question is a strange thing. First time that browse display, it's ok, I'm located at the first record. Second (and subsequent), I'm not located at the first record and I have to press the "first" button to be right. Aybody has an idea ?

Thanks
Sylvain

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Pagination and reseting a browse
« Reply #1 on: October 19, 2010, 06:31:46 AM »
Hi Sylvain,

Second question first - it starts with the record currently in the SessionId - so depending on how it's all set up it can jump in where it left off.

First question - the key here is understanding what will happen if the number of the records in the browse change between page refreshes. ie if data is added by another user, or if the filter changes, then obviously both the current page position, and the total number of records will change.

Also if a locator is in use then again you will need to re-calculate the current position.

But assuming you're ok with both of those, then you can test for a button press by looking for the button in the value queue. eg
if p_web.GetValue('prev_btn')
 ! decrease page counter by 1
end
etc
prev_btn, next_btn, first_btn, last_btn are the buttons you're interested in.

cheers
Bruce



sylvain

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: Pagination and reseting a browse
« Reply #2 on: October 19, 2010, 06:52:28 AM »
Hi Bruce,
thanks.
For the second question, how to force the browse to start with the first record (or how to reset the record in the session queue ?)

Thanks

Sylvain

Ubaidullah

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: Pagination and reseting a browse
« Reply #3 on: May 07, 2011, 10:55:38 AM »
Hi Bruce,
thanks.
For the second question, how to force the browse to start with the first record (or how to reset the record in the session queue ?)

Hi Sylvain,

Did you figure out how to achieve this?

Regards,
Ubaidullah Nubar.

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: Pagination and reseting a browse
« Reply #4 on: May 07, 2011, 12:34:54 PM »
Hallo,


I reset the browse like this:

In embed: After Browse Loop  then  5After</form>  I put this:
p_web.SetValue('refresh','first')

Everytime I open the browse it will go to first record.

Robert