The FormReader applet is an "Infobus-aware" data access applet that reads the contents of a form within an HTML document. The contents are then posted to the InfoBus.
By default, the FormReader applet does the following when accessing HTML form data:
If need be, the applet can be also used with a user interface. This can be helpful for application debugging. With the user interface, you can enter values in fields to change the initial values supplies by the URL and Item_Number HTML PARAM tags.
The FormReader applet is derived from the HTMLReaderApplet class, which uses the ParseHTML class to process the HTML.
The FormReader Parsing Process
The FormReader begins by accessing the desired HTML document via a supplied URL as soon as it is initialized. The reading of the URL is done in a separate thread to support cancelling/time-out. The document is then parsed on a token-by-token basis.
The data read by the FormReader applet is placed on the InfoBus in a KeyedDataSet, with the value keys being the names of the form fields.
The applet can dynamically respond to requests for forms via the infobus. If the ReaderRequest PARAM tag is supplied, you can send requests to the applet from other applets via the InfoBus.
Embedding the FormReader Applet in an HTML Document
The following code example demonstrates how an instance of the FormReader applet is embedded in an HTML page. The APPLET tag is immediately followed by PARAM (parameter) tags that provide the configuration information for the applet.
<APPLET NAME="formParse"
CODEBASE=".."
CODE="lotus.htmlparse.FormReader"
WIDTH=200
HEIGHT=250
ARCHIVE="jars/devpack_htmlparse_app.jar">
<PARAM NAME="cabinets" VALUE="cabs/devpack_htmlparse_app.cab">
<PARAM NAME="URL" VALUE="SalesForm.html">
<PARAM NAME="item_Number" VALUE="2">
<PARAM NAME="search_for" VALUE="Totals">
<PARAM NAME="ReaderRequest" VALUE="FORMREQUEST">
<PARAM NAME="show_ui" VALUE="true">
</APPLET>
FormReader Applet Parameter Tags
The following parameter (PARAM) tags are available for configuring the FormReader applet via HTML:
HTMLInputName PARAM tag
Item_Number PARAM tag
Name PARAM tag
ReaderRequest PARAM tag
Search_For PARAM tag
show_ui PARAM tag
URL PARAM tag
FormReader Applet Properties
The following properties are available for accessing the FormReader applet programatically:
ItemNumber property
Name property
SearchString property
URL property
FormReader Applet Methods
The following methods are available for accessing the FormReader applet programatically: