+var renderTargetsReqVar;\r
+var renderOnRecordTargetsReqVar;\r
+\r
+// Renders UI elements listed in 'renderWhileActiveclients', optionally doing\r
+// another update round-trip to Pazpar2 when done.\r
+function renderTargets(doRefresh) {\r
+ // console.log('rendering ' + renderWhileActiveclients);\r
+ var sourcecomp = document.getElementById("pz2watch:activeclientsField");\r
+ jsf.ajax.request(sourcecomp, null, {\r
+ render : renderWhileActiveclients\r
+ });\r
+ if (doRefresh) {\r
+ // console.log('Will do another ajax request after a timeout in order to\r
+ // render: pz2watch:activeclientsField');\r
+ renderTargetsReqVar = setTimeout(function() {\r
+ // console.log('Making request for pz2watch:activeclientsField');\r
+ jsf.ajax.request(sourcecomp, null, {\r
+ render : "pz2watch:activeclientsField"\r
+ });\r
+ }, 500);\r
+ } else {\r
+ // console.log("No further updates from server requested");\r
+ }\r
+}\r
+\r
+// Renders UI elements listed in 'renderWhileActiveclientsRecord', optionally\r
+// doing\r
+// another record request when done.\r
+function renderOnRecordTargets(doRefresh) {\r
+ // console.log('rendering ' + renderWhileActiveclientsRecord);\r
+ var sourcecomp = document.getElementById("pz2watch:activeclientsFieldRecord");\r
+ jsf.ajax.request(sourcecomp, null, {\r
+ render : renderWhileActiveclientsRecord\r
+ });\r
+ if (doRefresh) {\r
+ // console.log('Will do another ajax request after a timeout in order to\r
+ // render: pz2watch:activeclientsFieldRecord');\r
+ renderOnRecordTargetsReqVar = setTimeout(function() {\r
+ // console.log('Making request for pz2watch:activeclientsFieldRecord');\r
+ jsf.ajax.request(sourcecomp, null, {\r
+ render : "pz2watch:activeclientsFieldRecord"\r
+ });\r
+ }, 1000);\r
+ } else {\r
+ // console.log("No further updates from server requested");\r
+ }\r
+}\r
+\r
+// Listens for browser initiated changes to 'window.location.hash' and sends \r
+// the hash key changes to the back-end, to have the back-end pull up a previous \r
+// Pazpar2 state.\r
+// \r
+// See also: The field in pz2watch.xhtml, the StateListener function below,\r
+// the method Pz2Bean.handleQueryStateChanges(), and the classes \r
+// Pazpar2State and StateManager for a complete picture of browser history \r
+// handling.\r
+function windowlocationhashListener() {\r
+ if (trackHistory) {\r