Consultor Eletrônico



Kbase P22292: Example of using Selection Lists in Webspeed.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/25/2003
Status: Unverified

GOAL:

Example of using Selection Lists in Webspeed.

FIX:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<META NAME="AUTHOR" CONTENT="Alex Pearlstein">
<TITLE>WebSpeed Script</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.
Define variable numselected as integer.
Define variable i as integer.

Assign numselected = NUM-ENTRIES(get-value("reps"), ",").

Define temp-table pickedreps
field SalesRep as c
field RepName as c.

IF get-value("reps") gt "" THEN do:
DO i = 1 to numselected:
Find Salesrep where Salesrep.SalesRep = entry(i ,get-value("reps")) no-error.
IF available Salesrep THEN do:
Create pickedreps.
Assign pickedreps.SalesRep = Salesrep.SalesRep
pickedreps.RepName = Salesrep.RepName.
Release Salesrep.
END.

END.
END.


</SCRIPT>
</HEAD>

<BODY>
<Center>

<FORM method="Post" action="Example_selectionlist.html">
<SELECT NAME="Reps" SIZE=7 MULTIPLE>
<SCRIPT LANGUAGE="SpeedScript">
FOR each salesrep:
{&out} '<OPTION '.
If can-find(pickedreps where pickedreps.SalesRep = Salesrep.SalesRep) then
{&out} ' Selected '.
{&out} 'value="' Salesrep.SalesRep '">' Salesrep.RepName .
END.
</SCRIPT>
</SELECT>
<BR>
<input type="submit" name="button" value="submit">
</FORM>
<BR>
</Center>
You selected;<BR>
<SCRIPT LANGUAGE="SpeedScript">
FOR each pickedreps:
{&out} '<li>' pickedreps.RepName ' (' pickedreps.SalesRep ')</li><br>'.
END.
</SCRIPT>


</BODY>
</HTML>