This section contains primarily reference material that details what properties you can set for each form-field object and what methods you call to set these properties. However, there are a couple of things you should understand about HAHTsite form fields and their properties before you begin setting these properties.
First, as was mentioned earlier, each form field is a Java object. Therefore, it’s important to understand the relationships between the Java classes from which these objects are created. These class relationships are shown in the figure below.
As you can see, most of the classes that represent objects you can place on a page (like Button and Checkbox) are subclasses of FormField. This means that all the properties and property-accessor methods defined in the FormField class are inherited by the other classes shown. (For the purposes of this documentation, this hierarchy means that the reference information for an object of type Textbox is the union of the information presented for the FormField class and that presented for the Textbox class.) Combo is a subclass of as well, but this relationship doesn’t affect your use of these two
FormField
Buttons Checkbox FileUpload Listbox Radiobutton StaticText TextArea Textbox
Combo ListElement
The following code illustrates how you can set a member variable of an object directly:
HAHT recommends that you use the set methods to set form-field properties, and, consequently, the upcoming sections document these methods as the interface to use in setting and reading form-field properties. Again, though, the member variables that represent these properties are public and can be set directly. For a list of the member variables you can set for a particular object, see the online help for the HAHTsite Server Object Model.
The table below directs you to information about setting the properties of the object in which you’re interested.
Java staLastName.setValue("Apellido:"); HAHTtalk Basic staLastName.setValue "Apellido:" Java staLastName.Value = "Apellido:"; HAHTtalk Basic staLastName.Value = "Apellido:" Section Description
“FormField properties” on page 163
explains how to set and read the properties that are common to all form fields.
FormField is a superclass of all the other classes listed in this table; therefore, the methods listed here can be used with any form-field object.
“Button properties” on page 165 explains how to set and read the properties of a button (a Submit button, a Reset button, etc.)
FormField properties
As was mentioned earlier, FormField is a superclass of the classes representing the following form-field objects:
• Button • Check box • Combo box • File-upload control • List box • Radio button
“Checkbox properties” on page 167
explains how to set and read the properties of a check box
“Combo properties” on page 168 explains how to set and read the properties of a combo box
“FileUpload properties” on page 168
explains how to set and read the properties of a file-upload widget, which enables you to copy a file to the Application Server when you submit your form
“ListElement and Listbox classes” on page 169
explains how to change the contents of a list box at runtime
“Radiobutton properties” on page 175
explains how to set and read the properties of a radio button
“StaticText properties” on page 176
explains how to set and read the properties of a static-text object
“TextArea properties” on page 178
explains how to set and read the properties of a text-area widget
“Textbox properties” on page 178
explains how to set and read the properties of a text box
Because these objects are created from subclasses of the FormField class, you can use FormField methods to set properties that all of the objects have in common. For example, you can set the visibility of any object like this:
The following table lists the most commonly used set and get methods for use with all the subclasses of FormField.
Java
This code changes the Visible attribute of a Button object from on to off. It assumes that the object btnMoveFirst has already been instantiated.
btnMoveFirst.setVisible(false);
HAHTtalk Basic
This code changes the Visible attribute of a Button object from on to off. It assumes that the object btnMoveFirst has already been instantiated.
btnMoveFirst.setVisible False
Method Explanation
addExtAttr enables you to add an extended attribute to a form-field object. This extended attribute is an HTML attribute not represented by one of the object’s standard properties (value, etc.). Note that case matters when you’re storing and retrieving these extended attributes
setLabelAlignment determines whether a form field’s label is displayed on the left or right of the field when the page is browsed. See setLabel.
setLabel establishes the value of a label to be displayed to the left or right of the form field when the page is browsed. All form-field objects except those of type Button can display labels.
setName changes the name of the form field. You use this name to refer to the object that represents the form field.