Template panels

A TemplatePanel widget renders the HTML (possibly including JavaScript) that is specified by its Gosu template. Like all other interface rendering, the rendering is processed on the server so that the template can reference variables and other page state. To use JavaScript within your panel, do one of the following:
  • Include the JavaScript directly using the <script> tag. Note that your JavaScript will be executed every time the panel is rendered and sent to the client, so be careful about setting up global state.
  • Reference a global JavaScript library that you have configured. For example, in the file customer.js.

To configure a TemplatePanel so that JavaScript on the client side can call the server, set the attributes updateHandler and actionHandler.

See also