Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

PreviousPrevious NextNext

SOLUTION: Embedded View and Refresh causes crash.
Peter Szoldan 7.Jun.09 07:39 PM a Web browser
Domino Designer All Releases All Platforms


OK, I finally got it working. Main idea: start a NotesTimer with 1 sec intervals (the minimum) in the original UIDoc that polls the UIDoc.Document for an item "RefreshNeeded" every second; if the item is available, it refreshes the document, and removes the item (to avoid multiple refreshes.)
I clicked it like crazy for a while and it crashed only once out of 100 times. Removed the "Automatically refresh fields" setting in the form (thinking it might also be triggered and the two would interfere) and it doesn't seem to crash any more but no guarantees.
Performance:
The refresh happens in 1/2 seconds on average, and 1 sec at max, which is reasonably usable as I tested it.
The empty NotesTimer (just running, not refreshing) doesn't seem to have a measurable effect on my CPU usage, so I believe it's safe to use.

The code:
Form Globals (Declarations): [important to put it here and not in the Events script (Declarations) ]

Dim nt As NotesTimer
Dim thisUIDoc As NotesUIDocument

Form Postopen event:

Set thisUIDoc=Source ' I'm saving this for performance reasons - to avoid looking it up for each Alarm
Set nt = New NotesTimer(1)
On Event Alarm From nt Call TimerHandler

Create TimerHandler Sub under the Form event script:
Sub TimerHandler(Source As NotesTimer)
If thisUIDoc.EditMode Then ' I only need this when the doc is edited
If Not thisUIDoc.Document.GetFirstItem("RefreshNeeded") Is Nothing Then
Call thisUIDoc.Refresh
Print "Refreshing - "+Now() ' for debugging
Call thisUIDoc.Document.RemoveItem("RefreshNeeded")
End If
End If
End Sub

Embedded View script, either in an action or an event script:
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc=ws.CurrentDocument
uidoc.Document.RefreshNeeded="yes"

Have fun!




Embedded View and Refresh causes cr... (Mark Maden 4.Jun.09)
. . RE: Embedded View and Refresh cause... (Peter Szoldan 7.Jun.09)
. . . . RE: Embedded View and Refresh cause... (Peter Szoldan 7.Jun.09)
. . SOLUTION: Embedded View and Refresh... (Peter Szoldan 7.Jun.09)
. . . . RE: SOLUTION: Embedded View and Ref... (Mark Maden 8.Jun.09)
. . . . . . RE: SOLUTION: Embedded View and Ref... (Peter Szoldan 8.Jun.09)
. . . . . . . . RE: SOLUTION: Embedded View and Ref... (Henk SA Kruger 26.Aug.09)
. . . . RE: SOLUTION: Embedded View and Ref... (Jonathan Cohen 20.Sep.17)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite