Scout/HowTo/3.8/Creating a template

From Eclipsepedia

Jump to: navigation, search

Scout
Wiki Home
Website
DownloadGit
Community
ForumsBlogTwitter
Bugzilla
Bugzilla


This how-to describes how to create and use a template

Creating the template

  1. Create a GroupBox in a form
  2. Add form fields to the GroupBox and set their properties
    Image:TemplateCreationGroupBox.png
    Image:TemplateCreationFields.png
  3. Right click on the GroupBox and choose "Create template..."
    Image:TemplateCreationCreateTemplate.png
  4. Define the template name (or accept the default proposal)
    Make sure the two checkboxes are selected
    Image:TemplateCreationTemplateName.png


Using the template

The new template should now be listed under the Templates section in the client sub-project:

Image:TemplateCreationTemplateList.png

When adding new form fields, the new field should now be available:

Image:TemplateCreationUsingTemplate.png

In order to access the fields of a template in an SQL statement, use dot-notation (access to the fields works, even if auto-completion does not).

   SQL.selectInto("SELECT STREET, STREET2, ZIP, TOWN " +
                 "FROM ADDRESS " +
                 "WHERE ADDRESS_NO = :addressNo " +
                 "INTO :addressBox.street, :addressBox.street2, :addressBox.plz, :addressBox.town ",
                 formData);