I’ve made some simple code tests to figure out how this Google-Apps-Script works.
Now I’m facing an error message and I have no idea for what reason. Everything works like I want but running the code ends with a erros message ‘error encountered: An unexpected error occured’
I run this code as an Apps-script-gadget on my web-page.
Please help a beginner! 🙂
Here the code:
function doGet(e)
{
var app1 = UiApp.createApplication();
app1.add(app1.loadComponent("Panel1")); //Panel1 made with UI-tool
var but1 = app1.getElementById("Button1");
var handler = app1.createServerClickHandler('func1');
but1.addClickHandler(handler);
return app1;
}
function func1(e)
{
var app2 = UiApp.getActiveApplication();
app2.getElementById("TextBox1").setText("BigBrother");
return app2;
}
This is generally happening when using
getElementById()for an element that has no ID… please check in the GUI builder if your TextBox1 does have an ID set with the right value.EDIT : here is a screen cap.

and embedded in site :