Consultor Eletrônico



Kbase P22381: How to use HTML Form Buttons in Webspeed
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   25/11/2003
Status: Unverified

GOAL:

Example of trapping for buttons in Webspeed

GOAL:

Example of a Navigation Bar in Webspeed

FIX:

Save the following file to your Webspeed directory and compile it.
It requires a sports2000.db connection.
The file must be called EXAMPLE_NAVBAR.HTML

-------------------------------EXAMPLE_NAVBAR.HTML------------------------

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<META NAME="AUTHOR" CONTENT="Alex Pearlstein">
<TITLE>Nav Bar Example</TITLE>
<SCRIPT LANGUAGE="SpeedScript">
DEFINE VARIABLE currentcustomer as i no-undo.
DEFINE VARIABLE buttonpressed as c no-undo.
DEFINE VARIABLE notyet as c init "" no-undo.

PROCEDURE output-header:

ASSIGN currentcustomer = integer(get-value("tcustNum")).
ASSIGN buttonpressed = get-value("Action").
IF currentcustomer = 0 THEN
Assign currentcustomer = 1.
IF buttonpressed = "" THEN
assign buttonpressed = "First".

FIND FIRST customer where custnum = currentcustomer no-error.

CASE buttonpressed:

WHEN "First" THEN
find first customer.
WHEN "Last" THEN
Find Last Customer.
WHEN "next" THEN
Find next Customer.
WHEN "Prev" THEN
Find Prev Customer.
OTHERWISE
assign notyet = "This functionality is not in this sample.".

END CASE.

END.

</SCRIPT>
</HEAD>

<BODY>

<Form method="POST" Name="CustomerForm" action="EXAMPLE_NAVBAR.html" >

<table>
<TR><TD>number</TD><TD><input type="text" size="20" name="tcustNum" value=" `Customer.CustNum` "></TD></TR>
<TR><TD>country</TD><TD><input type="text" size="20" name="tstate" value=" `state` "></TD></TR>
<TR><TD>name</TD><TD> <input type="text" size="20" name="tName" value=" `name` "></TD></TR>
<TR><TD>address</TD><TD> <input type="text" size="20" name="taddress" value=" `address` "></TD></TR>
<TR><TD>city</TD><TD> <input type="text" size="20" name="tcity" value=" `city` "></TD></TR>
</table>

<input type="submit" name="Action" value="First">
<input type="submit" name="Action" value="Prev">
<input type="submit" name="Action" value="new">
<input type="submit" name="Action" value="Save">
<input type="submit" name="Action" value="delete">
<input type="submit" name="Action" value="cancel">
<input type="submit" name="Action" value="next">
<input type="submit" name="Action" value="last">
<input type="submit" name="action" value="SubmitOrders">
</Form>
<BR>
<BR><Center><B><Font color="Red">` notyet `</CEnter></Font></B>

</BODY>
</HTML>