The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CGI::Widget::DBI::Search::AbstractDisplay - Abstract Display class inherited by default display classes

SYNOPSIS

  package My::SearchWidget::CustomDisplayClass;

  use base qw/ CGI::Widget::DBI::Search::AbstractDisplay /;

  # ... implement abstract methods


  # then, when instantiating your search widget:
  my $ws = CGI::Widget::DBI::Search->new(q => CGI->new);
  ...
  $ws->{-display_class} = 'My::SearchWidget::CustomDisplayClass';

DESCRIPTION

This abstract class defines several methods useful to display classes, and is the base class of all default display classes (shipped with this distribution).

ABSTRACT METHODS

render_dataset()
display_dataset()

METHODS

display()

This is the top-level method called by CGI::Widget::DBI::Search. The default implementation calls the _set_display_defaults() and render_dataset() methods, then returns the result of the display_dataset() method.

If this method is overridden, it should return the rendering of the search widget UI from data values stored in the search widget's 'results' object variable (retrieved from the most recent call to its search() method).

_set_display_defaults()

Sets object variables for displaying search results. Called from display() method.

_init_header_columns()

Initializes list of columns to display in dataset, based on 'sql_table_display_columns' object variable, and -pre_nondb_columns, -post_nondb_columns, and -display_columns settings.

sortby_column_uri($column, $unescape)

Returns URI for sorting the dataset by the given column. If the dataset is currently sorted by $column, then the URI returned will be for reversing the sort.

next_page_exists()

Returns true if another page of search results exists after the current page.

prev_page_uri()

Returns URI of location to previous page in search results.

next_page_uri()

Returns URI of location to next page in search results.

first_page_uri()

Returns URI of location to first page in search results.

last_page_uri()

Returns URI of location to last page in search results.

make_nav_uri( $page_no )

Generates and returns a URI for a given page number in the search result set. Pages start at 0, with each page containing at most -max_results_per_page.

display_pager_links($showtotal, $showpages, $hide_if_singlepage)

Returns an HTML table containing navigation links for first, previous, next, and last pages of result set, and optionally, number and range of results being displayed, and/or navigable list of pages in the dataset.

This method is called from display() and should be treated as a protected method.

parameters: $showtotal boolean to toggle whether to show total number of results along with range on current page $showpages boolean to toggle whether to show page range links for easier navigation in large datasets (has no effect unless -show_total_numresults setting is set) $hide_if_singlepage boolean to toggle whether to display nothing if there is only one page of search results

display_record($row, $column)

Returns HTML rendering of a single record in the dataset, for column name $column. The $row parameter is the entire row hash for the row being displayed.

display_page_range_links()

Returns a chunk of HTML which shows links to the surrounding pages in the search set. The number of pages shown is determined by the -page_range_nav_limit setting.

SEE ALSO

CGI::Widget::DBI::Search::Display::Grid, CGI::Widget::DBI::Search::Display::Table,