DBIx::HTML::LinkedMenus

Convert SQL to 2 linked HTML popup menus
Download

DBIx::HTML::LinkedMenus Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ron Savage
  • Publisher web site:
  • http://search.cpan.org/~rsavage/

DBIx::HTML::LinkedMenus Tags


DBIx::HTML::LinkedMenus Description

Convert SQL to 2 linked HTML popup menus DBIx::HTML::LinkedMenus is a Perl module to convert SQL to 2 linked HTML popup menus.Synopsis use DBIx::HTML::LinkedMenus; my($linker) = DBIx::HTML::LinkedMenus -> new ( dbh => $dbh, base_sql => 'select campus_id, campus_name, campus_id ' . 'from campus order by campus_name', linked_sql => 'select unit_id, unit_code from unit where ' . 'unit_campus_id = ? order by unit_code', ); # Print as part of a form: print $q -> start_form... print $linker -> javascript_for_db(); print $linker -> html_for_base_menu(); print $linker -> html_for_linked_menu(); print $linker -> javascript_for_init_menu(); # Either this... print $q -> end_form(); # Alternately, print as part of a page: my(@on_load) = $linker -> javascript_for_on_load(); # Or these 2... print $q -> start_html({title => 'Linked Menus', @on_load}), print $q -> start_form... print $linker -> javascript_for_db(); print $linker -> html_for_base_menu(); print $linker -> html_for_linked_menu(); print $q -> end_form();This module's constructor takes a db handle and 2 SQL statements, and executes the SQL.The first SQL statement is used to create a pop-up menu - the base menu.The constructor returns undef if the SQL for the base menu returns 0 items.The second SQL statement is used to create another pop-up menu - the linked menu.By linked I mean each item in the base menu has a corresponding set of items in the linked menu.Eg: If the available selections on the base menu are A and B, and A is the current selection, then the linked menu will display (say) A1, A2 and A3. Then, when the user changes the current selection on the base menu from A to B, the javascript provided will automatically change the available selections on the linked menu to (say) B1 and B2. Requirements: · Perl


DBIx::HTML::LinkedMenus Related Software