Combo Box Maddness

bmoore

New Member
I am creating a webspeed application that will have a combo box to show the Customers name.
My goal is to have it return the following after you submit your choice:
1. Customer Name
2. Rate
3. Associate(person who handles this account)

So what is required to get this to return those values?
I am still fresh to progress, so I am looking for the "onSubmit" equivilent.

Here is what it looks like thus far, I now only need to get it work
RUN process-web-request.
{&out} "</select>" SKIP
"<H2>Select the client for report</H2>" SKIP
"<select name='client' multiple size='1' >" SKIP
"<option value='combobox' selected> - Choose client from list - </option>" SKIP.
{&out} "</SELECT>" SKIP
"<br><br>" SKIP
"<INPUT TYPE=SUBMIT NAME=~"range~" VALUE=~"SUBMIT~">" SKIP
"</FORM>" SKIP
"</CENTER>" SKIP.
{&out} "</BODY>" SKIP
"</HTML> "SKIP.
 
You should not use cgi-wrappers it is over complicated to make web pages like this. Just make a dispatch procedure which handles the calls from the webserver progress side and which sends the right page back. from this dispatch procedure you can. depending on the flow call the html procedures. like run teststuff.html which could be then name of below procedure. This way you separate the UI from the BL.

Just make an html page with embedded speedscript like this: (just like jsp or php)

Code:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
  <head><title>Test</title></head>
  <body onload="document.pageform.option.focus()">
  <form name="pageform" method="post" action="test">
  <input type="hidden" name="id" value="me">
  <select name="option" size="1">
    <option value="OPT1" <%=STRING(getSession("option")= "OPT1","selected/")%>>Option 1</option>
    <option value="OPT2" <%=STRING(getSession("option")= "OPT2","selected/")%>>Option 2</option>
    <option value="OPT3" <%=STRING(getSession("option")= "OPT3","selected/")%>>Option 3</option>
  </select>
  <br>
  <br>
  <input type="text" name="UserName"></td>   
  <br>
  <br>
  <input type=submit value="Don't push!" name=testsubmit>
  </FORM>
  </body>
</html>

In above example there is a form with a combobox and a textbox. The form is send to test, which essentially means that your dispatch procedure should be called test.p. In that procedure you can decide which page the reuqest came from by using get-value("id"). In this case id = 'me' and you can retrieve the values sent in the form with the same get-value function:
get-value('option') and get-value('Username').
In the example I make use of the default build in session management with which you can persists values between calls by using setSession and retrieving those values by using getSession.
If you use your own way of handling this then you should act accordingly. if you always submit to the same page then the use of get-value is enough. I just put it in, to point out that you will probably need some kind of sessionmanagement.

In the hml page above I check for a persistent stored value of "Option", if there is one I set that entry of the combobox as selected.

Well (too long) story, but in essence you just have to keep in mind that the html which is generated is pure HTML, you can use javascript client side etc... The speedscript stuff is only used during generation of the page. You can also use DHTML like onsubmit etc...

HTH,
Casper.
 
Aren't dispatch procedures a rather old and outdated method?
The origional ADM used dispatch though that approach was abandoned.
RUN dispatch IN handle ('name'). NOT very ABL approach
 
You are obviously confusing adm or adm2 with the literal meaning of the word dispatch.

Casper.
 
Now how do I return multiple fields after submit.
It is set up now to only return one value:

ELSE DO:
{&out} get-value('client').
END.
Which was defined in the select name:
"<select name='client' size='1'>" SKIP
"<option value='ALL' selected> - ALL - </option>" SKIP.
The goal here is to select the client, and return rates and also show the employee who handles the selected client.
these are in different tables ...
rates.rate & time-rec.sub_id
So what do I need to do this?
 
Back
Top