NAME

ePortal::HTML::List - List of objects support.

SYNOPSIS

This module is used to make a list of objects. Example:

<% $list->draw_list %>

<%method folder_name><%perl>
    my $list = $ARGS{list};
    my $obj = $list->{obj};
    . . .
</%perl>
<% HTML output %>
</%method>

<%method onStartRequest><%perl>
   my $obj = new ePortal::Notepad::View01;
   $list   = new ePortal::HTML::List( obj => $obj, class=>"smallfont" );
   $list->add_column_image();
   $list->add_column( id => "title", title => "Column title",
           width => "60%", url => "url.htm?objid=#id#");
   $list->add_column_method( id => "folder_name", title => "Folder name");
   $list->add_column_system( delete => 1);

   my $location = $list->handle_request;
   return $location if $location;

   $obj->restore_where($list->restore_parameters);
</%perl></%method>

METHODS

new()

Object contructor. Takes the same arguments as initialize()

initialize()

Object initializer. See Attributes for details.

handle_request()

Handle request and do redirect if needed. Return new location.

columns()

Returns array of ListColumn objects.

columns_count()

Returns a number of columns

add_column()

Add new column to the List. Arguments are:

  • title

    Column title

  • class

    class for the cell

  • align valign

    Cell alignment

  • id

    ID of the column. Should be unique for the List. This is field name for simple column.

  • nowrap

    Add nowrap tag to the cell

  • url

    URL for the cell content. The string like #arg# is replaced with value of attribute arg of the object

  • width

    Width of the cell

add_column_image()

Add a column with an image. See add_column() for arguments. Additional arguments are:

  • src

    URL for the image

add_column_image()

Add a column. A method named ID will be called for cell content. See add_column() for arguments.

add_column_enabled()

Add a column with ON|OFF state. Be default this column is linked to enabled object attribute. See add_column() for arguments.

add_column_image()

The same as add_column_enabled(). See add_column() for arguments.

add_column_system()

Add a system column. See add_column() for arguments. Additional arguments are:

  • acl

    Show ACL button

  • delete

    Show DELETE button

  • edit

    Show EDIT button

  • checkbox

    Show SELECTED checkbox

  • export

    Show EXPORT button

add_button_create()

Add a button Create new in action bar.

  • value

    Button caption

add_button_delete()

Add a button Delete in action bar.

  • value

    Button caption

add_cb()

Add combo-box to the list. See add_column() for arguments. Additional parameters are

  • values labels default

    Parameters for CGI::popup_menu

draw_list()

Draw the list.

restore_parameters()

List of parameters to pass to restore_where() function of ThePersistent object.

List Attributes

  • class

    Default class for all table cells

  • form_action

    ACTION attribute for the form. Default is $ENV{SCRIPT_NAME}

  • form_method

    Default is GET

  • form_name

    Default is 'theForm'

  • more_data

    1 if there is more data after draw_list()

  • pages

    Number of pages in the List. Undef if unknown

  • page

    Current page number

  • rowspan

    Space in pixels between rows

  • rows_per_page

    Rows to display per list page

  • obj

    The ThePersistent object to iterate

  • rows_fetched

    Rows fetched so far

  • after_row

    Method name to call after each row

  • before_row

    Method name to call before each row

  • total_columns

    Number of columns in the table.

  • list_cb

    combo-box default choice

  • edit_url

    url for icon_edit()

AUTHOR

Sergey Rusakov, <rusakov_sa@users.sourceforge.net>

1 POD Error

The following errors were encountered while parsing the POD:

Around line 1079:

Expected '=item *'