Forms and Event-driven Processing
Forms are the visual interface to an App Studio Maintain Data application, giving it a dynamic and attractive face while enabling you to make the application flexible and to place its power at the fingertips of the application end users.
You can design forms that enable end users to:
- Enter and edit data.
- Select options.
- Perform business logic, such as searching a data source for a customer order.
- Send email.
- Navigate the World Wide Web.
- Read application-specific help information.
- Control the flow of an application using an event-driven paradigm.
You develop these forms and the associated logic using the Form Editor. This is a sample form:
Forms are event-driven, and enable:
- Event-driven processing. Forms
are responsive to the needs of users because they recognize user
activity on the screen, that is, different types of screen events.
For example, a form recognizes what the user does on the screen
with the keyboard and mouse. It knows when users click a button
or change a field value.
Forms also enable you to assign tasks to these events. Each time a specified event occurs, Maintain Data automatically triggers the corresponding task. If you use events to trigger the application business logic, you can give the user more freedom, for example, over which editing tasks to perform, and in which order. You can also give the user access to more functionality, and more types of data, on a single screen. Event-driven processing gives the user more flexibility over the application, even as it gives the application more control over the user interface.
- Event-driven development. App Studio Maintain Data provides you with a simple way of developing event-driven applications, event-driven development. Because much of an application flow can be controlled from forms, you can develop the application as you paint its forms. You can first design the visual layout, then create controls, and finally code tasks, all from the HTML canvas. App Studio Maintain Data also offers the Language Wizard which generates code for you, making it faster and easier to develop effective interfaces and powerful applications.
For an introduction to using forms and developing event-driven applications, see Forms and Event-driven Processing, Forms and Event-driven Processing, and Forms and Event-driven Processing.
How to Use Forms
Forms are deployment-independent. You design a form to meet the needs of your application. App Studio Maintain Data automatically implements the form as a webpage. This enables you to focus on logic, and leave implementation details to App Studio Maintain Data.
Forms have standard form features, including:
- A title bar that identifies the form.
- Scroll bars that enable you to move the contents of a control vertically and horizontally if they extend beyond the control border.
Forms are displayed one at a time in one web browser session.
You can transfer control from one form to another, from a form to another Maintain Data procedure or to an App Studio procedure, and from a form to any Internet resource, such as an email client, a webpage, or an FTP server.
Designing a Form
Forms offer a diverse set of ways by which an application end user can select options, invoke procedures, display and edit fields, and get helpful information. For example, if you want the user to select an option or procedure, you can use any of the following controls:
- Buttons. You can specify a function to be performed when the end user clicks a button or image. Common examples are Done and Cancel buttons.
- Radio buttons. The end user can select one of a mutually exclusive group of options. For example, an employee could identify his or her department.
- Check boxes. The end user can select or deselect a single option or characteristic. For example, an applicant could indicate if this is the first time that he or she has applied.
- Combo boxes and list boxes. The end user can select one or more options from a dynamic list of choices.
- Menus. The end user can select an option from a drop-down menu or submenu.
If you want to display or edit data, you can use these controls:
- Edit boxes. You can use this control to edit a single value.
- Multi-line edit boxes. You can use this control to edit a long value wrapping onto multiple lines.
- HTML tables. You can use this control to view a data source stack.
- Grids. You can use this control to edit and view a data source stack.
Designing Event-driven Applications
The flow of control in conventional processing is mostly pre-determined, that is, the programmer determines the few paths that the user will be able to take through the procedure.
To make your application user interface more responsive to the user, App Studio Maintain Data offers event-driven processing. Each time that an event occurs, it invokes, or triggers, the assigned task. In App Studio Maintain Data, the event is something the application end user does in a form, and the task is a function or a URL. For example, you might create a button that, when clicked by a user, triggers a task that reads a data source and displays the data in the form.
Creating Event-driven Applications
Developing a procedure by writing out sequential lines of source code may be sufficient for conventional linear processing, but event-driven processing demands event-driven development. Developing an application in this way lets you build much of the application logic around the user interface. In effect, you develop the application as you develop the interface in the HTML canvas. For example, you could start by creating a form, creating a control, and then coding a task for one of the control events. App Studio Maintain Data also provides you with a number of automated tools for developing applications. For example, you can use the Language Wizard to generate source code for various operations such as retrieving and updating data.