Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a timer in Designer that works like a stopwatch...any ideas??

Status
Not open for further replies.

Sparrz

Technical User
Mar 25, 2003
17
CA
Can anyone help a newbie designer with a some code questions .... I am trying to find a way to easily create a timer that works like a stopwatch and have this stopwatch on a form in the database record the time used in a hidden area on the form, the info would hidden to users but not admins.

I have looked at NotesTimer class help info, but I do not understand how to implement the code they show in the help files.

I was thinking about trying a Java Stopwatch to do this but I am so new to designing in Lotus that I do not really know how to implement Java into notes. Does anyone have suggestions for a newbie designer.
 
Record the time used ?
Why not just record the time between edition and save of document ?
Also, a Notes doc can be read and not edited - in which case you cannot "record" anything on it when the user clears the doc from his window.
Are looking to find out how long a user "looks" at a document ? The only possibility I see for that is to create an activity log outside of the document (or even outside the database). An interesting undertaking for sure, but what is the added value of this ?
 
It is to record when the user has the form open when they close the document it does not have to record anymore. The window would be open for the duration of the use of the stopwatch only. Once the form is closed I would like it to save all of the form info to the database.

I want it to start recording after the 1st pause has been hit after the stopwatch is activated then the user would hit resume and the next time they hit pause, it records the next time frame and possibly filling out a new field everytime time the Pause button is hit with the time listed on the clock itself. This would be somewhat used as a break timer.
 
Still don't get it. Are you doing this for Web-use, or for Notes use ?
If the document (not form, document) is modified, then the user cannot quit the document without either saving the info or abandoning the info. So saving via the "stopwatch" is redundant. Again, if the doc was not in edit mode, there is nothing to save since nothing has changed, and the "stopwatch" is therefor useless.
What is the "pause" ? Are you showing an animation or something that requires more user interaction than just reading ?
If there is a button, why make a timer ? Just record the time the button is clicked and store it in a multi-value field.
It seems to me that you are trying to reproduce Visual Basic-like functionality into a Notes process. I fear that that is not the right way to approach Notes development.
A NotesTimer is used to retrigger a NotesDocument event. Most likely the PostRefresh, I would think. Which is not really useful since triggering a PostRefresh without anything happening is not normally going to change much.
Why do you need to fill a new field at a set interval ?
 
This is for Notes use, again it would be for a break timer, when the user starts their 1st break, they would click the the start button, when they come back from their 1st break they would click the pause button, at that point the 1st break amount would need to be recorded in a field below the the stopwatch. then when it came time for the next break the user would hit a resume button and timer continues the countdown, and so on and so fourth, until the end of the shift. This when the form or document would be closed and recorded times in the fields or the whole document would need to be saved to the database.

Basically I just want to know if there is a code out there that would produce an object that looks and works like a stopwatch but feeds info into fields every time the pause button is utilized, could it be javascript or should it be Lotus Script. The document can remain open until the stopwatch is no longer needed.
 
Right, now I'm getting it.
I think you have the wrong approach.
A Notes document is not a VB object that just hangs there and waits for someone to trigger an event. That is not how you should be thinking in my opinion.
What you want to do is create a record of activity. That means the user creates a new doc, specifies he is "in office", "out of office", "break", or "home", and records the document. The time is automatically recorded.
To make things a little nicer, you can set up a page with a pic of a stopwatch (as groovy as you like, like Rolex or Festina, or just plain whatever). Make hotspots on the pertinent areas of the pic (like color one area in green for start of day, one in red for end of day, one in grey for break, and one blue for "at work"), and create code that automatically creates and records a doc with the corresponding parameters.
You then have an activity log with all required information, that you can peruse at leisure and extract stats info from.

That is approximately how I would go about doing it in Notes if I had no other option.
 
I might be on the wrong track, unless there is a way to extract the data from a webpage that is used within notes into a document that is saved in the database which could be access for the records, the one problem with that is how would I get the data to differenciate between the users? Is there a possibility of Notes recording from a webpage at all?
 
Well, if you are not using Notes to display the page, I do not think so. But if Notes is displying the document in a browser, the modifications will logically be updated to the document when the user submits the info.
Try a simple db design, something like a phone book. Enable anonymous users to access the db and put it on the server running the http task.
Open the db in the browser and observe how you can open the documents and what they look like.
Then go back and make anonymous Editor. Close the browser and open a new one. Open the db again and observe how you can edit the info. be sure to add a Submit button with a FileSave @command, and you'll see just how easy it is to get info from the web in Notes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top