fixes for data form list fields

This commit is contained in:
Graham Knop 2008-06-12 19:40:19 +00:00
parent 0e299cc18b
commit dbe99c3295
2 changed files with 5 additions and 2 deletions

View file

@ -129,7 +129,7 @@ sub convertDataForm {
name => $fieldData->{name},
status => $fieldData->{status},
type => "\u$fieldData->{type}",
possibleValues => $fieldData->{possibleValues},
options => $fieldData->{possibleValues},
defaultValue => $fieldData->{defaultValue},
width => $fieldData->{width},
subtext => $fieldData->{subtext},

View file

@ -55,7 +55,7 @@ sub _createForm {
my $data = shift;
my $value = shift;
# copy select entries
my %param = map { $_ => $data->{$_} } qw(name height width extras vertical defaultValue);
my %param = map { $_ => $data->{$_} } qw(name height width extras vertical defaultValue options);
$param{value} = $value;
$param{size} = $param{width};
@ -64,6 +64,9 @@ sub _createForm {
if ($data->{type} eq "checkbox") {
$param{defaultValue} = ($param{defaultValue} =~ /checked/i);
}
elsif ( isIn($data->{type}, qw(selectList selectBox checkList radioList)) ) {
delete $param{size};
}
my $control = eval {
WebGUI::Pluggable::instanciate("WebGUI::Form::\u$data->{type}", "new", [ $self->session, \%param ]);
};