I have a frame (3 typical frames), One of the frames is the navigator, top is the selected view, and the bottom is the doc selected in the view. I want the view in the top frame, to be as live as possible. So that the user doesn’t have to refresh the frame, or view. I know there is the ReloadFrame, ReloadWindow, RefreshView, etc…but what if they’re in another app or other db, I don’t want them to get interupted while code makes the view active, or etc…So does anyone know of a way to make a view up-to-minute? I’d prefer up to the second, but will live with 5-10 seconds, also I don’t want to kill the system resources, so it’d be nice to put this load on the server if possible. So no matter what, any time you look at this view you’re pretty sure you’re getting a dynamic look at the data. And btw this is all for the notes client D6
Subject: A “live” as possible view
Hi,
dont know if this will work when you have it in frames but thats how you can create a automatically refreshing view.
Put the folliwing code into a view:
'Declarations
Dim Workspace As NotesUIWorkspace
Dim RefreshTimer As NotesTimer
Sub Postopen(Source As Notesuiview)
Set Workspace = New NotesUIWorkspace
Set RefreshTimer = New NotesTimer(2,"Refreshes the view.")
On Event Alarm From RefreshTimer Call RefreshTimerHandler
RefreshTimer.Enabled = True
End Sub
Sub RefreshTimerHandler(Source As NotesTimer)
Print Cstr(Now) " - Refreshing view ..."
Call Workspace.ViewRefresh
'Print ""
End Sub
Hope this helps
Bye
Hynek
PS: This one refreshed every 2 sec. which is only good for testing otherwise it is too often.
Remember that the timer will be running and triggering as long as the user has the view open that means even if he opens a document and the view is not currently visible.
Subject: RE: A “live” as possible view
There’s some danger in doing it this way. The event continutes to happen while the view is open, even if it’s not the top window in the display. But ViewRefresh operates on the top window, so there’s no telling what view you might be refreshing. Depending what’s on the screen, you might get an error. Every two seconds.
Furthermore, timer events overrunning each other can cause a client crash. Anything you do that might not complete before the next tick, you have to disable the timer and then re-enable it afterwards.
Subject: RE: A “live” as possible view
I do see this being a problem too, I’ll play around. Worse comes to worse, they’ll just have to click the refresh button. Not a terrible thing, just an inconvienience. Thanks for your responses!
Subject: RE: A “live” as possible view
Great thanks, I’ll see if I can get this to be of use.