Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
Web Objects : HTML mapping examples : Simple HTML mapping
 

Simple HTML mapping

HTML mapping usually begins with a file containing HTML form markup, like the example w-csget.htm:

w-cstget.htm

<!DOCTYPE HTML PUBLIC "-//Netscape Corp.//DTD HTML plus Tables//EN" "html-net.dtd">
<HTML>
<HEAD>
<TITLE>Customer Get</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF">
<H1>Customer Information</H1>
<FORM ACTION="w-cstget.w" METHOD="POST">
  <P>
  Enter Customer ID: <INPUT NAME="CustNum" SIZE="5">
  <INPUT TYPE="SUBMIT" NAME="Button" VALUE="Find"><BR><BR>
  Name: <INPUT NAME="Name" SIZE="20">
  --------Phone: <INPUT NAME="Phone" SIZE="20"><BR><BR>
  Address 1: <INPUT NAME="Address" SIZE="20"><BR>
  Address 2: <INPUT NAME="Address2" SIZE="20"><BR><BR>
  City: <INPUT NAME="City" SIZE="12">
  ---State: <INPUT NAME="State" SIZE="20">
  ---Zip: <INPUT NAME="PostalCode" SIZE="10"><BR><BR>
  Comments: <TEXTAREA NAME="Comments" ROWS="2" COLS="30"></TEXTAREA>
  </P>
</FORM>
</BODY>
</HTML>
Note that this file is equivalent to w-sstget.html. However, it does not contain any embedded SpeedScript. (Also notice that the call to the Web object w-cstget.w is an attribute of the FORM element in w-csget.htm.) Instead of embedding SpeedScript in this file, you can use the HTML Mapping Wizard in the AppBuilder to:
*Map each INPUT and TEXTAREA form element to a field in the Sports2000 database.
*Generate an offset file that specifies the position of the form elements in the HTML that is returned to the client.
*Edit process-web-request, which controls the flow of your Web object logic, by adding a SpeedScript FIND statement.
*Create w-cstget.w by compiling and saving in the AppBuilder.
* Mapping form elements to database fields
* Generating the offset file
* Editing process-web-request
* Compiling and running
* SpeedScript form buffer
* An alternative to form buffer input