3 use CXGN
::Page
::Form
::Select
;
5 package CXGN
::Page
::Form
::EditableSelect
;
7 use base qw
/ CXGN::Page::Form::Select /;
21 print STDERR
"Instantiating new EditableSelect...\n";
24 #foreach my $k (keys %args) { print "Args to add_select $k, $args{$k}\n<br />"; }
25 my $self = $class->SUPER::new
(%args);
33 print STDERR
"Rendering Editable Select...\n";
34 my $select_id = $self->get_id();
35 my $select_name = $self->get_field_name();
36 my $box = qq { <select id
="$select_id" name
="$select_name"> };
37 foreach my $s ($self->get_selections()) {
39 #if (exists($s->[0])) { print STDERR "S0 = $s->[0]\n"; }
40 #if (exists($s->[1])) { print STDERR "S1 = $s->[1] INPUT:".($self->get_contents()). "\n"; }
42 if (exists($s->[1]) && ($s->[1]=~/\d+/) && ($s->[1] == $self->get_contents())) {
43 $yes = "selected=\"selected\"";
45 elsif (exists($s->[1]) && ($s->[1]=~/\w+/) && ($s->[1] eq $self->get_contents())) {
46 $yes = "selected=\"selected\"";
49 $box .= qq { <option value
="$s->[1]" $yes>$s->[0]</option
> };
52 $box .= qq { </select> };