[AWS] What's the 'best' way to use AWS as a end-user interface tool ?

Colwell, Samuel C @ VTC SColwell at vtc.vsc.edu
Mon Aug 2 14:26:25 CEST 2010


Brett,

You have several options here.  I'll list a couple of the simpler ones.

If you want a separate dispatcher for each, you can place each button in its own form with the action set to a unique URI.  The downside is that this will not send the data in the "main" form unless you do some sneaky client-side scripting.  If you put the main form data with the "save" button, this may be acceptable for your application.

There are two easy ways to handle multiple buttons in the same form.  The important thing to realize is that only the clicked button will be transmitted with the rest of the form data.  If you give your button a name and a value, this is easy to check for.  You can either give the buttons unique names and see which one shows up in the form data set, or give the buttons the same name but different values (the value being what actually shows up on the button when displayed).  Then you can look into the form data to see which button was pressed by looking at the value for a particular name.  The downside to this is that it will be dispatched to the same callback function.  If the program is not too complex, this is generally not a huge issue.

I can provide some demonstration code if you need it.

-Sam Colwell
________________________________________
From: aws-bounces at lists.adacore.com [aws-bounces at lists.adacore.com] On Behalf Of brett hallett [dragoncity at aanet.com.au]
Sent: Sunday, August 01, 2010 9:05 AM
To: AWS
Subject: [AWS] What's the 'best' way to use AWS as a end-user interface tool    ?

I need to create a very small data capture form for myself and decided
to try Ada + AWS + Browser rather than wade into GTK+ as the GUI
interface. The data entry form is not very complex and does not require
a large widget set.

Using the example code in GEM #29, I have a program interacting with a
web page using despatchers.URI, with additional URI messages I have
added, but these are of course entered into the web browser 'command
line'. I now wish to develop the program to respond to user click-able
buttons on the form.

The typically : first , last, next, back, clear, save, delete, exit :
buttons are intended, and the Ada program should display the desired
previously entered record(s), however, I am unsure how to 'connect' a
HTML button click in such a way that the dispatcher is called to direct
the button click to the desired Ada function(s) in my program.

What little information I could find regarding AWS usage just glosses
over the actual handling of multiple user-clickable buttons on a form.

Any advice appreciated.
--
Cheers,
Brett
_______________________________________________
AWS mailing list
AWS at lists.adacore.com
/no-more-mailman.html


More information about the AWS mailing list