Fix some broken Form fields. Fixes bug #11611

This commit is contained in:
Colin Kuskie 2010-06-06 22:29:52 -07:00
parent 8d85912da7
commit d81a28b235
6 changed files with 58 additions and 1 deletions

View file

@ -125,7 +125,9 @@ sub getTypes {
}
my %fields = ();
foreach my $type (@types) {
$fields{$type} = WebGUI::Pluggable::instanciate('WebGUI::Form::'.ucfirst($type), 'getName', [$self->session]);
my $name = WebGUI::Pluggable::instanciate('WebGUI::Form::'.ucfirst($type), 'getName', [$self->session]);
$self->session->log->warn("type: $type; name: $name");
$fields{$type} = $name;
}
return \%fields;
}

View file

@ -36,6 +36,31 @@ The following methods are specifically available from this class. Check the supe
=cut
#-------------------------------------------------------------------
=head2 getName ( session )
Returns the human readable name of this control.
=cut
sub getName {
my ($self, $session) = @_;
return WebGUI::International->new($session, 'WebGUI')->get('user');
}
#-------------------------------------------------------------------
=head2 isDynamicCompatible ( )
Since this Form field requires a thingId to work it is not dynamic compatible.
=cut
sub isDynamicCompatible {
return 0;
}
#----------------------------------------------------------------------------
=head2 www_getThingFields ($session)

View file

@ -58,6 +58,19 @@ Defaults to the setting textBoxSize or 30 if that's not set. Specifies how big o
#-------------------------------------------------------------------
=head2 getName ( session )
Returns the human readable name of this control.
=cut
sub getName {
my ($self, $session) = @_;
return WebGUI::International->new($session, 'Form_Username')->get('username');
}
#-------------------------------------------------------------------
=head2 getValue ( [ value ] )
Retrieves a value from a form GET or POST and returns it. If the value comes back as undef, this method will return the defaultValue instead. Strip newlines/carriage returns from the value.