How do I start a procedure by pushing a button?

jonas

New Member
I'm fresh at this game, and there may be a simple solution to this, but I can't find it. What I'm trying to do is simply to run a webspeed procedure by pushing a button. So that it would be something like this:

************************************************************
<?WS>
Procedure test.
{&out} base.table.field.
End Procedure.
</?WS>

input type="Button" name="button" value="run" 'on choose of button run test.'
************************************************************
In which that last trigger function of course doesn't work...
 

Greg

New Member
In order to execute a procedure you need to post a request to the web server. The request is then processed by a CGI wrapper. As a rule you need to look at it as client/server with the client only being the display of information to the user. The "post" to the server is what actually results in your procedure being executed. If you requre more information, post a reply. Right now I must be brief...

Greg
 

Greg

New Member
Well, I will give this a shot ( I am on holidays right now and don't have any actual code :cool: )

You have your HTML file with code like this:

<FORM ACTION="test.w" METHOD="POST">
<input (this is your button) type=button name=run>
<INPUT TYPE="HIDDEN" NAME="1" VALUE="One">
<INPUT TYPE="HIDDEN" NAME="2" VALUE="Two">
</form>

Your CGI wrapper needs to be set from the progress editor, in this example we will use the file name "test.w". The CGI wrapper is executed by the server when the button on the HTML page is pushed. Everything with in the <form> tag is available to the wrapper using the GET-VALUE API call. I will show this below...

-- test.w -- File is generated from the appbuilder

/* setup your variables in the area specified withing the appbuilder. */

define variable Vbutton as character no-undo.
define variable Vtest as character no-undo.

/* get your values from the posted web page */

assign Vbutton = GET-VALUE( "button" ).
/* Vbutton will contain the value from the html page. In this case "run" */

if Vbutton = "run" then do:
/* put your code in here to execute your procedure */
end.


That is a start for you...

Greg
 

Greg

New Member
Forgot this is viewed as html, here is the html example...
Without the tags...

FORM ACTION="test.w" METHOD="POST">
input (this is your button) type=button name=run>
INPUT TYPE="HIDDEN" NAME="1" VALUE="One">
INPUT TYPE="HIDDEN" NAME="2" VALUE="Two">
/form>
 

Chris Kelleher

Administrator
Staff member
Originally posted by Greg
Forgot this is viewed as html, here is the html example...

Actually, I guess it makes sense to disable HTML inside posts in the WebSpeed forum so that people can post code without it being interpreted by the browser... now you should be able to see the code just fine.

-Chris
 
Top