Hello,
I am completely new to JavaScript and currently trying to find my way around some basics.
Right now I am trying to access a widget from a function with findWidget(widgetId)
and I can’t get it to work. Here is the script I’m using:
execute: function () {
function testFunction(widget) {
console.log("testFunctionActive");
var checkBoxWidget = widget.findWidget("01").isChecked();
console.log(checkBoxWidget);
}
studio.ui.showModalDialog({
windowTitle: "Window Title",
windowWidth: 340,
windowHight: 120,
widgetType: studio.ui.widgetType.Layout,
layout: studio.ui.layoutType.VBoxLayout,
items: [
{
widgetType: studio.ui.widgetType.CheckBox,
widgetID: "01",
text: "CheckBox",
isChecked: false
},
{
widgetType: studio.ui.widgetType.PushButton,
widgetID: "pushButton",
onClicked: function(){
testFunction(this);
}
}
]
})
}
Can someone tell me what I’m missing here?
Thanks!
Katharina