[Home] [About Me] [My Software] [Acknowledgements]

HTML::AutoWidget

The Idea

The aim of this perl subsystem is to simplify 'simple' user entry form for CGI scripting. It make the generation of dialog box relatively straight forward and allow easily abstraction of data

HTML::Autowidget

This is no longer has any work done on it as I now use Autowidget::HTML which I present futher down this page. However you might find this early version might be easier to user.

Client interface

The main module HTML::AutoWdiget exports two functions:- Essentially thats it.

This means you can do a

     
     my @data = get_params($query , 
     			   ['Begin Date' , new HTML::AutoWidget::Date('begin') ],
                           ['End Date' , new HTML::AutoWidget::Date('end') ] );
						    
    if ($#data > 0 ) {
    	# Process with params...
    } else {
    	# tidy up html and wait for next invocation...
    }
Inside your CGI scripts to simplify step-by step querying of the user.

Widget interface

Compliant widgets need to support:-

How to get HTML::AutoWidget

I currently consider HTML::AutoWidget to be beta but for those of you brave enough to try it you can download a simple tar-gz file from here

AutoWidget::*

This recode is design to make the interface more generic, the big change the early version is no output is generated during or before the verify phase. HTML::AutoWidget assumed that a valid HTML container up to and including the <BODY> tag had been output before get params.

The new Autowidget doesn't require this, and his design to be indepent of UI and and encapsulation api. Eg. we have AutoWidget::CGI::Controller which handles the processing of output wether it be the existing AutoWidget::HTML or a possible AutoWidget::XML Additionally I currently plan an AutoWidget::Curses::{Controller,Widgets}

Stop Press!!(09 April 2002) This may not happen, I might just suggest use of Curses::UI instead

Download It!

Client Interface

The client interface is simpler in concept than the previous on although more verbose to implement. my $query = new AutoWidget::CGI::Controller; replaces your existing usage of CGI.pm.

Then AutoWidget::CGI::Controller provides a do_modal call which will display a HTML page (of AutoWidget::HTML style objects and exit if they fail to verify . If verify is succesful the nothing is output and do_modal returns the output of get_data() on the first item in the list.

Widget Interface

This is much bigger than the previous HTML::Autowidget interface although made easier to build quick widgets, via base class of AutoWidget:HTML::Base and AutoWidget:HTML::Tag, which I urge you to use. To create a new widget you probably only need to override new(), render() and verify(). - If you use AutoWidget:HTML::Tag, you may not need to override render.

Package functions

This functions are part of the package and don't operate on a specific instance (execpt arguably new).