Hi all,
May be its obviuos but it took me time to get it working.
If you have a Browse paged and want to show the total rows and the page number the user are seeing, you can use these enbeds to achieve this.
DATA
define two variables to hold the values, lets say
loc:TotalRows and loc:ActualPage
CODE
! At Start of "After SetView"
! [Priority 5000]
direction# = loc:direction
!to remenber the browse buttons action
! At Start of "After Browse Before Buttons"
! [Priority 5000]
!--------------------------------------------------------------------------------------------------------------------------------------
loc:TotalRows = !here you need to provide total of rows,
!if the browse are not filtered and you are using TPS then it may be just RECORDS(YourTable)
!if you are using SQL the you can do a SELECT COUNT(*)...
!--------------------------------------------------------------------------------------------------------------------------------------
LOC:ActualPage=p_web.GetSessionValue('LOC:ActualPage')
case direction#
of 1
LOC:ActualPage = 1
of -2
LOC:ActualPage -= 1
of 2
LOC:ActualPage += 1
of -1
LOC:ActualPage = loc:TotalRows/loc:pagerows
end
IF LOC:ActualPage<1 THEN LOC:ActualPage=1.
p_web.SetSessionValue('LOC:ActualPage',LOC:ActualPage)
packet = clip(packet) & |
'<<table><13,10>'&|
' <<tr><13,10>'&|
' <<td>Total rows: <<!-- Net:s:loc:TotalRows --><</td><13,10>'&|
' <<td>Page: <<!-- Net:s:loc:ActualPage --><</td><13,10>'&|
' <</tr><13,10>'&|
'<</table><13,10>'&|
''
do SendPacket
And thats all...
Bruce: May be a good idea for a NetBrowse template new tab... Totaling
Defining the variable containing the Total rows, the one for the page,an embed to do the calc and a text to add the XHTML to display them.
It is very usefull with big browses for the user to know at where page are they looking at.
Just my 2 cents, I hope it will be usefull.
Alberto