The Component Reference - Basic Concepts

From a heitml programming point of view, a component used on a page is a call of a constructor that creates a heitml object. For each component kind there is a component class definition, contained somewhere in the heitml library. For example counter is defined in the file cocounter.hei library. This means components behave just like ordinary user defined heitml tags:

  • Components can be placed on pages by using the appropriate tag.
  • Tag parameters can be constants or arbitrary heitml expressions.
  • Components can be called anywhere inside a heitml page or program, directly on the page, inside control structures like if or while, or inside other user-defined tags.
So it is possible to use the components in your programs just like a library of predefined tags. The specialty of components however is that components can be edited using RADpage.

Component Live Time

When heitml processes a page that contains a component < comp > heitml will call the constructor method of the class named comp. This creates a heitml object of the comp class, or in short a comp-object. The comp class will then display the component (by generating the appropriate HTML code and exit). In the simplest case the comp object vanishes after this processing and so is not visible on the outside. An example is <counter>.

heitml features so called interactive components that accept user input. Examples for interactive components are a counter with reset button or a dbform. In the Internet context user input is sent to the Web server as a subsequent page request. For example the dbform is shown in a first page request. Then the user fills out the form and presses the submit button. This causes the browser to send the form data and another page request to the server. Interactive components remain active from the first page request until this second page request. Before the second page is processed by the server, the still existing interactive components process the information provided by the browser and perform the desired action. For example a dbform would store the data entered into the database.

Additionally there are so called persistent components. A persistent component is created the first time its page is displayed. It then stays active until it is explicitly deleted or until it becomes too old and expires. The iaContainer is such a persistent component, as is a dbform. A dbform keeps the field values. Even if the user goes to another page and comes back the dbform will still display the same data (unless explicitly triggered to display something else).

Component Hooks

The functionality of certain components can be altered by adding own methods, called hooks. For example a checkrecord method can be added to a dbform to check the consistency of the data entered. iaButton and iaLink need a process method, that performs a user-defined action when the button or link is pressed.

The extend button of RADpage can be used to program these hook methods. When the extend button is pressed RADpage adds a new class definition to the page. The new class inherits from the component class. Then methods for the new class that override the default methods of the component class can be defined.

For example suppose there is a dbform on a page. Pressing extend adds a class definition

<defclass dbform1; inherit dbform></defclass>

to the page and uses dbform1 instead of dbform. This will not change the behavior of the page, because dbform1 inherits everything from dbform. However now hook methods can be redefined:

<defclass dbform1; inherit dbform>
<def checkrecord; 
   if isempty(this.ff.Guest_Name); return "Guest Name must be present"; /if

The component reference contains a list and descriptions of all available component hooks for each component.

This page was dynamically generated by the web application development tool RADpage of H.E.I.
© 1996-2017 H.E.I. All Rights Reserved.

Component Guide
  Language Guide
  Language Ref.
  Component Ref.
    Component List
    Component Table
  Class Library
  User Components
  Tryout Form
  New Features
  heitml 1
User Guide
Discussion Group