Guest User

Untitled

a guest
Feb 10th, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function doGet() {
  2.   var app = UiApp.createApplication();
  3.   var t = app.createTextBox().setName("tbox").setId("tbox").setValue("set before invoking handler");
  4.   app.add(t);
  5.  
  6.   var h = app.createServerHandler("myHandler").addCallbackElement(t);
  7.   var chk1 = app.createCheckBox().addValueChangeHandler(h).setValue(true,true);
  8.  
  9.   Utilities.sleep(500);
  10.   t.setValue("set after invoking handler");
  11.  
  12.   SpreadsheetApp.getActive().show(app);
  13. }
  14.  
  15. function myHandler(e) {
  16.   var app = UiApp.getActiveApplication();
  17.   SpreadsheetApp.getActive().toast(e.parameter.tbox)
  18.   app.getElementById("tbox").setValue("set in handler!");
  19.   return app;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment