Chapter 3. Building an Interface

What’s in a UI?

A User Interface, or UI, is what you see when you turn on a computer. It may be an action-packed blockbuster movie or a single flashing green “>”, but one thing is for sure, this is your way to interact with the machine. When we talk about building a UI, we are typically speaking of the part that your user will need to interact with your application. Text to read, pictures to look at, boxes to type in, and buttons to push are what we call widgets. To keep these elements from dropping to the bottom of the screen in a big pile, we will place them in panels. A panel is a container that allows the widgets to be generally arranged on the screen. You can have panels within panels and widgets inside widgets, or even panels inside widgets. The combinations are virtually unlimited (pun intended). Part III contains examples of widgets and panels available in the UiApp.

When we build a UI in Google Apps Script, there are three ways to present the UI to the user: in a spreadsheet, in a Google Site as a gadget, or as a web page, which we call standalone. Please see Chapter 1 for a detailed description of each UI display type. For this chapter, the focus will be on the standalone UI.

When you publish your stand alone UI it gets a Google hosted web page with a little bit of HTML and some JavaScript wrapped around your code. Google Script uses GWT technology to send your script to the browser as highly optimized JavaScript. This process increases security ...

Get Google Script: Enterprise Application Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.