Form inheritance work for lists, removal of $session{os}{slash}

This commit is contained in:
Colin Kuskie 2005-12-01 20:46:55 +00:00
parent abe85d439e
commit 99df1f414e
90 changed files with 1364 additions and 1168 deletions

View file

@ -15,7 +15,7 @@ package WebGUI::Form::HiddenList;
=cut
use strict;
use base 'WebGUI::Form::Control';
use base 'WebGUI::Form::List';
use WebGUI::International;
use WebGUI::Session;
@ -25,11 +25,11 @@ Package WebGUI::Form::HiddenList
=head1 DESCRIPTION
Creates a list of hidden fields. This is to be used by list type controls (selectList, checkList, etc) to store their vaiuses as hidden values.
Creates a list of hidden fields.
=head1 SEE ALSO
This is a subclass of WebGUI::Form::Control.
This is a subclass of WebGUI::Form::List.
=head1 METHODS
@ -65,11 +65,8 @@ sub definition {
my $class = shift;
my $definition = shift || [];
push(@{$definition}, {
options=>{
defaultValue=>{}
},
defaultValue=>{
defaultValue=>[]
formName=>{
defaultValue=>WebGUI::International::get("hidden list","WebGUI"),
},
profileEnabled=>{
defaultValue=>1
@ -78,20 +75,6 @@ sub definition {
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 getName ()
Returns the human readable name or type of this form control.
=cut
sub getName {
return WebGUI::International::get("hidden list","WebGUI");
}
#-------------------------------------------------------------------
=head2 toHtml ( )
@ -102,31 +85,7 @@ A synonym for toHtmlAsHidden.
sub toHtml {
my $self = shift;
$self->toHtmlAsHidden;
}
#-------------------------------------------------------------------
=head2 toHtmlAsHidden ( )
Renders an input tag of type hidden.
=cut
sub toHtmlAsHidden {
my $self = shift;
my $output;
foreach my $key (keys %{$self->{options}}) {
foreach my $item (@{$self->{value}}) {
if ($item eq $key) {
$output .= WebGUI::Form::Hidden->(
name=>$self->{name},
value=>$key
);
}
}
}
return $output;
return $self->toHtmlAsHidden;
}
#-------------------------------------------------------------------