1
|
/*
|
2
|
Author: Mike Adair mike.adairATccrs.nrcan.gc.ca
|
3
|
License: LGPL as per: http://www.gnu.org/copyleft/lesser.html
|
4
|
|
5
|
$Id: ServiceRegistryList.js 3091 2007-08-09 12:21:54Z gjvoosten $
|
6
|
*/
|
7
|
|
8
|
// Ensure this object's dependancies are loaded.
|
9
|
mapbuilder.loadScript(baseDir+"/widget/WidgetBaseXSL.js");
|
10
|
|
11
|
/**
|
12
|
* Widget to display a list of web services from a registry.
|
13
|
* TBD: not compelted yet.
|
14
|
*
|
15
|
* @constructor
|
16
|
* @base WidgetBaseXSL
|
17
|
* @param widgetNode This widget's object node from the configuration document.
|
18
|
* @param model The model that this widget is a view of.
|
19
|
*/
|
20
|
|
21
|
function ServiceRegistryList(widgetNode, model) {
|
22
|
WidgetBaseXSL.apply(this,new Array(widgetNode, model));
|
23
|
|
24
|
/**
|
25
|
* Handles submission of the form (via javascript in an <a> tag)
|
26
|
*/
|
27
|
this.submitForm = function() {
|
28
|
alert("submitForm");
|
29
|
|
30
|
//create the http GET URL
|
31
|
//TBD: handle POST submission
|
32
|
//TBD: create filter request
|
33
|
var webServiceUrl = this.webServiceForm.action + "?";
|
34
|
for (var i=0; i<this.webServiceForm.elements.length; ++i) {
|
35
|
var element = this.webServiceForm.elements[i];
|
36
|
webServiceUrl += element.name + "=" + element.value + "&";
|
37
|
}
|
38
|
alert(webServiceUrl);
|
39
|
config.loadModel( this.targetModel.id, webServiceUrl);
|
40
|
}
|
41
|
|
42
|
/**
|
43
|
* Refreshes the form onblur handlers when this widget is painted.
|
44
|
* @param objRef Pointer to this CurorTrack object.
|
45
|
*/
|
46
|
this.postPaint = function(objRef) {
|
47
|
objRef.webServiceForm = document.getElementById(objRef.formName);
|
48
|
//objRef.WebServiceForm.onsubmit = objRef.submitForm;
|
49
|
//objRef.WebServiceForm.mapsheet.onblur = objRef.setMapsheet;
|
50
|
}
|
51
|
|
52
|
//set some properties for the form output
|
53
|
this.formName = "WebServiceForm_";// + mbIds.getId();
|
54
|
this.stylesheet.setParameter("formName", this.formName);
|
55
|
}
|
56
|
|