This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jul 28, 2011, 9:33 PM
13 Posts

Getting a handle on a document in CLJS

  • Category: Dojo and Client Side JavaScript
  • Platform: Windows
  • Release: 8.5.2
  • Role:
  • Tags: Javascript
  • Replies: 2
I am writing a timecard-like web app in Xpages. Employees will punch in and a record with the timestamp will be written out to the db. 
 
I want to prevent them from putting in another punch within, say, two minutes of their first one. 
 
I am trying to write some CLJS in the on click even of the submit button. I want to get their most recent entry and compare that to the time they clicked.  
 
I have a computed field on the form with the following code: 
 
var empnbr = requestScope.employeeCC;
var notesView:NotesView = database.getView("(TimeCardsByEmployee)");
var doc:NotesDocument = notesView.getDocumentByKey(empnbr);
var dt:NotesDateTime = doc.getItemValue("PunchDateTime")[0];
dt
 
This correctly displays the last PunchDateTime. 
 
In the on click event I have
 
var lstpnctme= document.getElementById("#{id:dt}").value; 
 
and some other code. But when I use firebug my var lstpnctme is undefined.  
 
Any help would be greatly appreciated. 
Jul 29, 2011, 6:25 AM
14 Posts
Re: Getting a handle on a document in CLJS
Try dojo.byId()
Jul 29, 2011, 9:39 AM
129 Posts
Re: Getting a handle on a document in CLJS
A computed field on the server results in a span node (if tagName isn't specified) in the browser. field.value only works for form fields in the browser.
 
Use .innerHTML to get the content of the computed field in the browser. 
 
I understand IBM's reasoning behind calling it a computed field (computed field in "regular" domino applications), but if they called it computed text, maybe fewer people would be confused. 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal