Hi,
Handler method for onSelectView event coded in init.js is not being called in Vizio TV.
CODE
(function (event) {
//code comes here
}).subscribeTo(KONtx.application, "onSelectView");
Thanks,
Icaurs
I was able to subscribe to the application class and listen for the onSelectView event in a test widget on a Vizio tv with the following software versions:
engine: 5.4.9
framework: 1.3.18.E
container: 1.4.1.E
I popped up a dialog when entering my home sidebar view. Here is my code in init.js:
CODE
(function (event) {
log(">>>>>>>>>>>>>>>>>>>>>>>>");
log(">>>>>>>>>>>>>>>>>>>>>>>>");
log($dump(event));
log(">>>>>>>>>>>>>>>>>>>>>>>>");
log(">>>>>>>>>>>>>>>>>>>>>>>>");
if (event.payload.viewId === "view-Home") {
new KONtx.dialogs.Alert({
title: "Test Dialog",
message: "This is a test to see if Vizio honors the onSelectView event",
buttons: [{
label: "Ok",
callback: function () {
log("OK!");
}
}]
}).show();
}
}.subscribeTo(KONtx.application, "onSelectView"));
It popped up the dialog as expected (note that dialogs can't be raised in snippet views).