1

I have a published service on my script, the link to which I pass out to an email. Once the active account invokes the service a UiApp opens up for further processing. I do that using doGet(). Once the processing on the UiApp is complete I have a Submit button, linked to a server click handler, which is supposed to process the changes made through the UiApp forms. While I am able to change the values on the spreadsheet that I wish to change using this UiApp, I still have two issues which I encounter on clicking the Submit button:

  1. The Ui App doesn't close on pressing the submit button
  2. I am not able to call a browser msgBox to give a process complete verification message.

I have read a lot that on closing and returning the app the UiApp is supposed to get closed, but it isn't happening and I am assuming this is because that happens only if there is no serverClickHandler involved. I could be wrong.

Can someone help me with resolving Issue 1 and getting around Issue 2? A relevant version of my doGet and clickHandler functions are attached below.

function doGet(e) //On invoking service in the mail.
{
  //Adding all other elements of the UiApp here
  /* …
     …  All other elements of the UiApp
     …
*/
  //Adding Submit button to the UiApp
  var button = app.createButton('Submit');
  var handler = app.createServerClickHandler('click').addCallbackElement(panel);
  button.addClickHandler(handler);
  panel.add(button);
  app.add(panel);
  return app;
}

 function click(eventInfo) {
   var app = UiApp.getActiveApplication();
 //Processing the actions that have to be performed on hitting the submit button
/* …
   … Processing the actions that have to be performed on hitting the submit button
   …
*/
   app.close();
   return app;
 }
4

1 回答 1

2

Browser.messageBox 在已发布的 UiApp 中不可用,您应该使用不可见的标签,直到您在流程结束时使其可见。另一个问题也不是问题:UiApp 无法关闭您的浏览器窗口,您可以简单地使 UI 的主面板不可见。

结合这两种修改将允许您隐藏表单并将其替换为“已完成,感谢提交”消息。

于 2012-06-14T20:02:15.400 回答