Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
Web Objects : HTML mapping examples : Simple HTML mapping : Generating the offset file
 
Generating the offset file
When the HTML Mapping Wizard completes, it automatically creates an offset file that contains the type and location of each form element in the HTML file. The offset file generated from w-csget.htm is called w-cstget.off and looks similar to the following:

w-cstget.off

/* HTML offsets */
htm-file= C:\PROGRESS\WRK\examples\w-cstget.htm
version=
field[1]= "CustNum,INPUT,,fill-in,11,20,11,50"
field[2]= "Name,INPUT,,fill-in,13,7,13,35"
field[3]= "Phone,INPUT,,fill-in,14,16,14,45"
field[4]= "Address,INPUT,,fill-in,15,12,15,43"
field[5]= "Address2,INPUT,,fill-in,16,12,16,44"
field[6]= "City,INPUT,,fill-in,17,7,17,35"
field[7]= "State,INPUT,,fill-in,18,11,18,40"
field[8]= "PostalCode,INPUT,,fill-in,19,9,19,43"
field[9]= "Comments,TEXTAREA,,editor,20,11,20,66"
When it runs, an HTML mapped Web object uses the offset file to determine where to insert data values in the HTML that it generates. The numbers at the end of each field line in w-cstget.off indicate where the form field begins and ends in the w-csget.htm source file.
Note: If you make any changes in your HTML source files, you should generate a new offset file. All of positional information might become invalid even if you make minor changes to your source files. Since manual editing is error prone, you should use the HTML Mapping Wizard and to generate a new offset file. You can also automatically re-map by opening the Web object in the AppBuilder. An updated offset file will be generated. The Progress® WebSpeed® Transaction Server also automatically generates the offset file at run time if the file does not exist or is out of date.
When the HTML Mapping Wizard completes and saves the offset file, you will see the tree view representation of the object, as shown in the following figure.
Figure 6. Tree view of HTML mapping source
By selecting a node in the tree view you can modify the code or properties of the section represented by the node.
Notice that there is a procedure called htmOffsets in the tree view. When htmOffsets runs in the final Web object, it creates the associations between the HTML form fields and the database fields. The Web object then refers to the offset file, w-cstget.off, to determine where to place the data in the HTML output.