Consultor Eletrônico



Kbase P95594: How to pass a value from a link in one html page to another html page?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/17/2008
Status: Verified

GOAL:

How to pass a value from a link in one html page to another html page?

GOAL:

How to pass a value from a link between two web objects using SpeedScript?

FACT(s) (Environment):

WebSpeed 2.x
WebSpeed 3.x
OpenEdge 10.x
All Supported Operating Systems

FIX:

In the following illustration, two HTML pages are created.  The sports2000 database is used to access the state field, which holds abbreviated form of state name, from State table in the state.html page.  In the details.html page, the StateName field of State table is used to display the complete name of the state. 1.  Create a state.html page by pasting the following code and compile it: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<META NAME="AUTHOR" CONTENT="Your Name">
<TITLE>WebSpeed SpeedScript Example</TITLE>
<SCRIPT LANGUAGE="SpeedScript">
/* Create an unnamed pool to store all the widgets created by this procedure.
   This is a good default which assures that this procedure's triggers and
   internal procedures will execute in this procedure's storage, and that
   proper cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.
</SCRIPT>
</HEAD> <BODY>
<TABLE Border="2" Align="center">
<CAPTION>Click on the State</CAPTION>
<TR> <TH>State</TH>
<SCRIPT LANGUAGE="SpeedScript"> 
  /*------------------------------------------------------------------
    File:
    Description:
    Created:
  -------------------------------------------------------------------*/
DEFINE VAR sname as char no-undo. FOR EACH state no-lock:
assign sname = state.state. </SCRIPT> <TR> <TD><a href=details.html?sname=` sname `>` sname `</a></TD> </TR> <SCRIPT LANGUAGE="SpeedScript"> END. </SCRIPT> </TABLE> </BODY>
</HTML> 2. Create the details.html page by pasting the following code and compile it: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<META NAME="AUTHOR" CONTENT="Your Name">
<TITLE>WebSpeed SpeedScript Example</TITLE>
<SCRIPT LANGUAGE="SpeedScript">
/* Create an unnamed pool to store all the widgets created by this procedure.
   This is a good default which assures that this procedure's triggers and
   internal procedures will execute in this procedure's storage, and that
   proper cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.
</SCRIPT>
</HEAD> <BODY>
<SCRIPT LANGUAGE="SpeedScript"> 
  /*------------------------------------------------------------------
    File:
    Description:
    Created:
  -------------------------------------------------------------------*/
DEFINE VAR sdesc as char no-undo.
FIND state where State.State=get-value("sname") no-lock no-error.
    IF AVAILABLE(state) THEN DO:
    assign sdesc=State.StateName. </SCRIPT>
<table border="0" width="100%">
<tr>
    <td width="15%" >
    <p align="left"><b>
    <font face="Microsoft Sans Serif" size="3">State Name:&nbsp;` sdesc `</font></b></td>
    
 </tr>
 </table>  <SCRIPT LANGUAGE="SpeedScript">
     END.
</SCRIPT> </BODY>
</HTML> 3. Run the state.html page to test the application.