Project

General

Profile

1
/*
2
License: LGPL as per: http://www.gnu.org/copyleft/lesser.html
3
$Id: Timestamp.js 3879 2008-02-27 14:20:29Z gjvoosten $
4
*/
5

    
6
// Ensure this object's dependancies are loaded.
7
mapbuilder.loadScript(baseDir+"/widget/WidgetBaseXSL.js");
8

    
9
/**
10
 * Adds a timstamp listener to show the curretn timestamp value in a form.
11
 * @constructor
12
 * @base WidgetBaseXSL
13
 * @author Mike Adair mike.adairATccrs.nrcan.gc.ca
14
 * @param widgetNode      The tool node from the Config XML file.
15
 * @param model  The ButtonBar widget.
16
 */
17
function Timestamp(widgetNode, model) {
18
  WidgetBaseXSL.apply(this,new Array(widgetNode, model));
19

    
20
  //set some properties for the form output
21
  this.formName = "TimestampForm_" + mbIds.getId();
22
  this.stylesheet.setParameter("formName", this.formName);
23

    
24
  this.updateTimestamp = function (objRef, timestamp) {
25
    var form = document[objRef.formName];
26
    if (form) {
27
      form.timestampValue.value = getNodeValue(objRef.model.timestampList.childNodes[timestamp]);
28
    }
29
  }
30

    
31
  this.model.addListener("timestamp",this.updateTimestamp, this);
32
}
33

    
34

    
(121-121/145)