[AWS] can HTML field type TEXT be used for interactive use ?

brett hallett dragoncity at aanet.com.au
Thu Apr 21 07:20:56 CEST 2011


On Wed, 20 Apr 2011 14:20:43 +0200
Thomas Løcke <thomas.granvej6 at gmail.com> wrote:

> On Wed, Apr 20, 2011 at 7:40 AM, brett hallett
> <dragoncity at aanet.com.au> wrote:
> > Hello,
> > I'm using Ada-AWS for some simple data entry tasks and in a effort
> > to reduce the amount of 'overhead' coding and have written a AWS
> > Code Generator which automatically converts a KompoZer HTML file
> > into a complete AdaCore-GPS project ( .adb, .gpr, etc ) which are
> > generated with little input from the developer ( me) who then adds
> > local logic code as necessary. Its quite a rapid way to get a
> > working AWS program.
> >
> > However I find that </textarea is the only field type that seems to
> > offer true interactive usability. ie: will both allow input and
> > updating. TEXT appears to allow only inputting.
> >
> > Is this a limitation of HTML or AWS ?
> >
> > The attached example program gets two values from a TEXT field , but
> > has to display the results in a TEXTAREA field, and it also appears
> > that its difficult to control its displayed field size and
> > value alignment and is somewhat 'chunky'. ( A HTML problem I guess)
> 
> 
> Hey Brett,
> 
> I'm not quite sure I understand your issue completely, but it does not
> sound like a problem related to AWS.

Thats what I'm trying to find out :-) , the problem is that if I use a
<INPUT TEXT type field, it does not seem possible to update it from a
program using AWS, if in fact if such an update is possible anyway.

> 
> AWS is an Ada implementation of the HTTP/1.1 protocol as defined in
> the RFC 2616. The fact that you can use AWS to transfer HTML really
> doesn't mean that AWS has anything to do with whatever HTML problems
> you might have, unless of course you're using web blocks and Ajax as
> per
> http://www.adacore.com/wp-content/files/auto_update/aws-docs/aws.html#Web-Block-and-Ajax
> - this is to  my knowledge the only place where AWS enters the world
> of HTML, but since you don't specifically mention this, I suspect
> you're not using web blocks?

No I just building a simple html form using a an Ada string
> 
> Also I wonder why you aren't using Templates_Parser for your output?

Mainly because I'd forgotten all about it :-) and I found that
generating a complete AdaCore Project from a HTML was petty easy to do,
and a nice exercise in Ada String Handling,
once I'd been pointed in the right direction by a experienced AWS user.

> It's a perfect match for AWS.

I'll definitely have another look at it - thanks for reminding me about.
it.

> And what exactly is happening in
> calcarea2_cb.AWS_CB?

OK, there are two input fields ( length & width ) and one output field
( result ). and a 'compute' button. ( its a simple test of AWSGEN).

You enter two numbers, press compute and the result ( length * width )
should appear, which it does if the field type is </textarea>, if the
result field is TEXT , nothing appears and the original input data
disappears from the form -- I see the entered data in the the POST
string. I can enter data into fields of type TEXT, but cannot
update/display new values in them. Hence my query if it was some
limitation in AWS ( for what ever reason), or in HTML TEXT Type.

Replacing all TEXT types with TEXTAREA solved that problem, the
original data remains & the results field is updated. I had to do
some CSS to get the fields nicely formatted and dimensioned.

> 
> Use CSS to prettify your HTML. There are plenty of tutorials.

Indeed I did find some very good tutorials, which were very useful, but
none addressed the input/output actions of field type TEXT

> Actually, if you're in a controlled environment (ie. you control the
> browsers used), then I'd take a good long look at HTML5. You can
> create some very nice interfaces when combining HTML5/CSS/Javascript.

I currently use IceWeasel 3.5 ( firefox) under aptosid/debian, and
according to a HTML5 web site firefox 3.5 does not cover HTML5 well.
But I note that Firefox 4 does.

Thanks for your interest
> 
> Regards,
> Thomas Løcke
> _______________________________________________
> AWS mailing list
> AWS at lists.adacore.com
> /no-more-mailman.html
> 



-- 
Cheers,
Brett


More information about the AWS mailing list