Kbase 20502: Example of Populating Form Objects Dynamically (Webspeed)
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/16/2008 |
|
Status: Unverified
GOAL:
How to pulate Form Objects Dynamically with Webspeed
FACT(s) (Environment):
Progress 9.x
WebSpeed 3.x
SYMPTOM(s):
HTML Form
FIX:
Follow these steps to use this example:
1) Copy all of the code from below the Dynamicpopulation.html separator.
2) Click (in the Progress AppBuilder) on "New".
3) Select "Blank Object".
4) Highlight all of the preset code in blank.
5) Paste the copied formexample.html text over the existing text.
6) Save this code.
7) Compile this code.
8) Run this code.
9) Select/enter data into the web objects.
10) Click on "Submit".
The code sample:
=====================Dynamicpopulation.html======================
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta name="AUTHOR" content="Alex Pearlstein">
<title>Example of dynamic population of form objects</title>
</head>
<form method="POST" name="FormExample">
<script language="SpeedScript">
Def var Choice as char.
</script>
<TR>
<td><center><B>How would you like to display your
choices</b></center></td>
<BR>
<td><center><b>
<Select name="fselect" Size="4">
<option Value="Radio">Radio Sets
<option Value="Selection">Scrolling Selection List
<option Value="Checkbox">Checkboxes
<option Value="pull">Pulldown Selection List
</b></center></td>
<BR>
<tr>
<td><center><input type="submit" name="SubmitBtn"
value="Submit"></center></td>
<body>
<HR>
<Center>
<script language="SpeedScript">
assign choice = get-value("fselect").
IF choice <> "" and choice NE "selection" and choice NE "pull" THEN
do:
FOR each customer where cust-num < 10:
</script>
<input type=`choice` name=`name` Value=`name`>`name`<BR>
<script language="SpeedScript">
End.
end.
IF choice = "selection" THEN do:
</script>
<td><center><b> Selection List</center></td>
<td><center><b><Select name="Cselect" Size="5">
<script language="SpeedScript">
FOR each customer where cust-num < 10:
</script>
</B><option Value=`name`>`name`
<script language="SpeedScript">
End.
End.
IF choice = "pull" THEN do:
</script>
<td><center><b>Pulldown Selection List</center></td>
<td><center><b><Select name="Cselect" Size="1">
</B><option selected>Click Here
<script language="SpeedScript">
FOR each customer where cust-num < 10:
</script>
<option Value=`name`>`name`
<script language="SpeedScript">
End.
End.
</script>
</body>
</html>