
Hi All,
We have embedded dashboards using the JS API and sometimes see a issue that trusted ticket has expired, but have set the expiry timeout sufficiently high but still notice the issue.
Is there a way we can find in the JS API that we can catch this scenario, we want to trigger some action based on this like send admin a notification.
i tried to have a try / catch block like this
try {
tableauViz = new tableau.Viz(frameDiv[0], url, {
onFirstInteractive: function(){
});
} catch(e) {
// perform some action if the trusted ticket raise an exception
}
but the control does not come in catch block because there is no exception raised.
Any possible workaround to catch this event using JS API?
Thanks
OK, it's not great, obviously could break and is not supported but it looks like when the viz fails to load we still make the iframe but it is set to 1 by 1 pixel and visibility as hidden. Therefore, you could do something like this as a hack to check for load failures:
$("iframe").on('load', function(){
if (this.style.visibility === "hidden") { // could also do size check here as well
// ...handle issue
}
});
Note this only works if there is no width and height set in the options. A hacky way to implement this would be to have a hidden div (display:none;) where you are testing the load with no width/height and then trashing it.