DBIx-HTML-ClientDB
view release on metacpan or search on metacpan
lib/DBIx/HTML/ClientDB.pm view on Meta::CPAN
=item javascript_for_client_on_load()
Returns a string to be used as a <body> tag's onLoad event handler. It calls the
function which initializes the menu. The function itself is included in
the code returned by javascript_for_db().
Output it as part of the <body> tag. See examples/test-clientdb.cgi for an
example.
Calling this method is optional. If you do not call it, then calling the method
javascript_for_client_init() is mandatory.
=item new(%arg)
The constructor.
See the previous section for details of the parameters.
=item param($id)
Returns an array of database fields corresponding to the menu value chosen.
Call this to convert the value returned to the CGI script when the user
selected a menu item, into the database fields which appeared in the second
column of the table.
In other words, convert the first column of the SQL into the values of all the
columns corresponding to that first column.
=item size()
Return the number of rows returned by your SQL.
Call this after calling 'table'.
It will tell you whether or not your menu is empty.
=item table()
Return the HTML for the table.
=back
=head1 Sample Code
See examples/test-clientdb.cgi for a complete program.
You will need to run examples/bootstrap-menus.pl to load the 'test'
database, 'campus' and 'unit' tables, with sample data.
You'll have to patch these 2 programs vis-a-vis the db vendor, username
and password.
The sample data in bootstrap-menus.pl is simple, but is used by several
modules, so don't be too keen on changing it :-).
=head1 See Also
CGI::Explorer
DBIx::HTML::LinkedMenus
DBIx::HTML::PopupRadio
=head1 Repository
L<https://github.com/ronsavage/DBIx-HTML-ClientDB>
=head1 Support
Bugs should be reported via the CPAN bug tracker at
L<https://github.com/ronsavage/DBIx-HTML-ClientDB/issues>
=head1 Author
C<DBIx::HTML::ClientDB> was written by Ron Savage I<E<lt>ron@savage.net.auE<gt>> in 2002.
Home page: http://savage.net.au/index.html
=head1 Copyright
Australian copyright (c) 2002, Ron Savage.
All Programs of mine are 'OSI Certified Open Source Software';
you can redistribute them and/or modify them under the terms of
The Artistic License, a copy of which is available at:
http://www.opensource.org/licenses/index.html
=cut
( run in 1.904 second using v1.01-cache-2.11-cpan-97f6503c9c8 )