NetTalk Central

Author Topic: Browse timer  (Read 4273 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Browse timer
« on: July 29, 2010, 07:51:24 AM »
I know about the problems and mi idea are to minimize it.
I have a browse which is refreshed every 9 seconds, but... it is needed in a certain period of time, lets say from 10 to 17hrs.
I know I cant stop the page from the client side, but.
What if I, at 17hs, delete all the sessions, forcing the user to loggin again.

1st Question:
-If the user do nothing, the client browser will continue sending requests to the server, the question is: having all the sessions deleted at 17, will the server respond?

Then, if the user realized it was logged out and loggin again I can set the timer to 0 and the browse will not refresh till 10hr when I again logged out all sessions
If the user logs in between 10 and 17 I set the timer to 9 secs,
If the user logs in between 17 and 10 I set the timer to 0 secs, disabling it.

2nd Question
-Can I use the browse filter to make the browse empty and modify the "No records found" message to tell the user it must logged in again?

3rd Question
-Any quick way of delete all sessions?

THanks
Alberto

-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Browse timer
« Reply #1 on: July 31, 2010, 12:15:33 AM »
Hi Alberto,

Deleting all the sessions sounds like a fairly drastic method. If the browse you are refreshing was "required login" then it _might_ work, but it sounds like a terrible hack.

Here's another approach;
set the timer field on the browse to a variable, say loc:timer.
right click on the procedure, and see where loc:timer is used.
Then just before that embed something like;

If clock() < 8 * 360000 or clock() > 17 * 360000
  loc:timer = 0
else
  loc:timer = 6000
end

Capiche?
Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Browse timer
« Reply #2 on: July 31, 2010, 05:13:22 AM »
Thanks Bruce, may be I´m confused.
I know your idea will work for a client requesting the browse, if it request the browse from 10 to 17 it has the timer and if not... not... but..
As I understand the browse refreshed only the data part but no the entire page.
Will it work with a client that has the browse open and refreshing and the time is changing from 16:59 to 17?, will the timer change for an opened browse?
And if I set the timer to 0 then it will never referesh, then the timer will never be activated again.
THanks
Alberto
« Last Edit: July 31, 2010, 06:17:23 AM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Browse timer
« Reply #3 on: July 31, 2010, 09:24:11 PM »
yes the timer will change for an opened browse.

yes, it won't _start_ again at 8am by itself. Perhaps between 17:00 and 8am you could just increase the time as much as possible, so it still polls just really really slowly.

Bruce

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Browse timer
« Reply #4 on: October 07, 2010, 03:26:37 PM »
Hi All,

I'm trying to change a timer on a browse after it has refreshed 20 times.

My trace shows that the timer value has been updated after 20 refreshes but the browse still refreshes every 3 seconds based on the original timer set.

What am I missing?

  L:Timer = p_web.GSV('ReportLogRefreshTime')
 p_web._trace('printlog=' & p_web.GSV('ReportLogRefreshTimes') & ' timer=' & L:Timer)

! End of "Start of CallBrowse routine"
  If p_web.RequestAjax = 0
    p_web.Message('alert',,,Net:Send)   ! these 2 should have been done by here, but this handles cases
    p_web.Busy(Net:Send)                ! where they are not done.
  End
  p_web.DivHeader('PrintLogBrowse',p_web.combine(p_web.site.style.browsediv,))
  if loc:ParentSilent = 0
    do GenerateBrowse
  elsIf p_web.RequestAjax = 0
    do OpenFilesB
    do LookupAbility
    do CloseFilesB
  End
  p_web.DivFooter()
  p_web._RegisterDivEx(loc:divname,L:Timer,'''refresh=current''','''_parentProc='&clip(loc:parent)&'''')