The following XML/Javascript was working in 6.4 to update the lastupdatedtime id. In 6.5 the javascript is now only being called on initial page load. Anyway to get the javascript code called on every refresh like it was in 6.5? Thanks.
Simple XML:
<form refresh="300" script="pageinit.js,system_summary_widths.js">
<label>System Summary</label>
<fieldset submitButton="false">
<html>
Last updated: <span id="lastupdatetime"></span>
</html>
Javascript:
require([
"splunkjs/mvc",
"splunkjs/mvc/simplexml/ready!"
], function(mvc) {
var d = new Date();
var n = d.toLocaleString();
document.getElementById("lastupdatetime").innerHTML = n;
});
Change my javascript to update the time when one of the searches on the page finishes.
require([
"splunkjs/mvc",
"splunkjs/mvc/simplexml/ready!"
], function(mvc) {
var mySearch = splunkjs.mvc.Components.getInstance("baseSearch_wifi_bytes");
mySearch.on('search:done', function(properties) {
var currentDateTime = new Date();
var currentDateTimeLocalizedString = currentDateTime.toLocaleString();
document.getElementById("lastupdatetime").innerHTML = currentDateTimeLocalizedString;
});
});