From dbe99c329580dd1285e5e427fd345bdc662282a3 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 12 Jun 2008 19:40:19 +0000 Subject: [PATCH] fixes for data form list fields --- docs/upgrades/upgrade_7.5.10-7.5.11.pl | 2 +- lib/WebGUI/Asset/Wobject/DataForm.pm | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/upgrades/upgrade_7.5.10-7.5.11.pl b/docs/upgrades/upgrade_7.5.10-7.5.11.pl index e2880efce..a615a3040 100644 --- a/docs/upgrades/upgrade_7.5.10-7.5.11.pl +++ b/docs/upgrades/upgrade_7.5.10-7.5.11.pl @@ -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}, diff --git a/lib/WebGUI/Asset/Wobject/DataForm.pm b/lib/WebGUI/Asset/Wobject/DataForm.pm index 0cbd9e755..10f9a6572 100644 --- a/lib/WebGUI/Asset/Wobject/DataForm.pm +++ b/lib/WebGUI/Asset/Wobject/DataForm.pm @@ -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 ]); };