Kbase 20533: Example: Query with Dynamic Output in WebSpeed (3.x)
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/16/2008 |
|
Status: Unverified
GOAL:
How to Query with Dynamic Output in WebSpeed
GOAL:
Query a database and build a dynamic table to display the information within.
FACT(s) (Environment):
WebSpeed 3.x
FIX:
Follow these steps to use the example:
1) Copy all of the code from below the Queryexample.html separator.
2) Click on "New" in the Appbuilder.
3) Select "Blank Object".
4) Highlight all of the preset code in blank.
5) Paste the copied queryexample.html text over the existing text.
6) Save the code.
7) Compile the code.
8) Run the code.
9) Enter a cust-num into the field.
10) Click on "Submit".
The queryexample.html code is as follows:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta name="AUTHOR" content="Alex Pearlstein">
<title>WebSpeed Script</title>
</head>
<body>
<form method="POST" name="SearchForm">
<input type="hidden" name="Navigate" value="Search">
<script language="SpeedScript">
def var fname as char.
assign fname = get-value("SearchField").
</script>
<TD>
<center>Please enter the cust-num of the customer you would like to
display 
<input type="text" size="24" name="SearchField"><BR>
</TD>
<BR>
<td><center><input type="submit" name="SubmitBtn" value="Search"
tabindex="2"></td>
<BR>
<HR>
<BR><center><table border="5" cellpadding="1" cellspacing="2"
bgcolor="white">
<script language="SpeedScript">
IF get-value("SearchField") = "" THEN do:
end.
Find sports.customer where cust-num = INT(get-value("SearchField")).
</script>
<TD><B>Customer Number:</TD></B><TD>`cust-num`</TD><TR>
<TD><B>Customer Name:</TD></B><TD>`name`</TD><TR>
<TD><B>City:</TD></B><TD>`city`</TD><TR>
<TD><B>State:</TD></B><TD>`state`</TD><TR>
<TD><B>Postal:</TD></B><TD>`Postal`</TD><TR>
</body>
</html>