added sol100 and chado cvterm pages to validate_all.t
[sgn.git] / lib / CXGN / Page / Form / EditableMultiSelect.pm
blob30cf31382755069c4a92bbab82b149cd24070d57
1 =head1 NAME
3 CXGN::Page::Form::MultiSelect;
5 =head1 DESCRIPTION
7 Implements a static (non-editable) multiple-selection list on a static form. For more information, see L<CXGN::Page::Form>.
9 =head1 AUTHOR(S)
11 Evan Herbst
13 =cut
15 use strict;
16 use CXGN::Page::Form::MultiSelect;
18 package CXGN::Page::Form::EditableMultiSelect;
20 use base qw/ CXGN::Page::Form::MultiSelect /;
22 =head2 new
24 Usage:
25 Desc:
26 Ret:
27 Args:
28 Side Effects:
29 Example:
31 =cut
33 sub new
35 my $class = shift;
36 my %params = @_;
37 my $self = $class->SUPER::new(%params);
38 return $self;
41 =head2 render
43 Usage:
44 Desc:
45 Ret:
46 Args:
47 Side Effects:
48 Example:
50 =cut
52 sub render
54 my $self = shift;
55 my $html = "<select id=\"" . $self->get_id() . "\" name=\"" . $self->get_field_name() . "\" multiple=\"multiple\">";
56 for(my $i = 0; $i < scalar($self->get_choice_array()); $i++)
58 if($self->is_selected($i))
60 $html .= "<option value=\"" . $self->get_choice($i) . "\" selected=\"selected\">" . $self->get_label($i) . "</option>";
62 else
64 $html .= "<option value=\"" . $self->get_choice($i) . "\">" . $self->get_label($i) . "</option>";
67 return $html . "</select>";
70 return 1;