From af4efc0333ab0b19ef520f254ef62ae8ebad283f Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 7 May 2003 00:48:00 +0000 Subject: [PATCH] Fixed bug 725211 --- lib/WebGUI/Wobject.pm | 3 ++- lib/WebGUI/Wobject/Poll.pm | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/WebGUI/Wobject.pm b/lib/WebGUI/Wobject.pm index 22077d99c..4d7de7e19 100644 --- a/lib/WebGUI/Wobject.pm +++ b/lib/WebGUI/Wobject.pm @@ -412,9 +412,10 @@ The name of the property to retrieve the value for. =cut sub getValue { + my $currentValue = $_[0]->get($_[1]); if (exists $session{form}{$_[1]}) { return $session{form}{$_[1]}; - } elsif (defined $_[0]->get($_[1])) { + } elsif (defined $currentValue) { return $_[0]->get($_[1]); } else { return $_[0]->getDefaultValue($_[1]); diff --git a/lib/WebGUI/Wobject/Poll.pm b/lib/WebGUI/Wobject/Poll.pm index ee4231386..a73f6f839 100644 --- a/lib/WebGUI/Wobject/Poll.pm +++ b/lib/WebGUI/Wobject/Poll.pm @@ -72,7 +72,8 @@ sub new { }, question=>{}, randomizeAnswers=>{ - defaultValue=>1 + defaultValue=>1, + fieldType=>"yesNo" }, a1=>{}, a2=>{}, @@ -107,7 +108,7 @@ sub purge { #------------------------------------------------------------------- sub www_edit { - my ($i, $active, $voteGroup, $graphWidth, $answers, $randomizeAnswers); + my ($i, $answers); for ($i=1; $i<=20; $i++) { if ($_[0]->get('a'.$i) =~ /\C/) { $answers .= $_[0]->getValue("a".$i)."\n"; @@ -154,7 +155,7 @@ sub www_edit { $layout->yesNo( -name=>"randomizeAnswers", -label=>WebGUI::International::get(72,$_[0]->get("namespace")), - -value=>$randomizeAnswers + -value=>$_[0]->getValue("randomizeAnswers") ); my $output = $_[0]->SUPER::www_edit( -layout=>$layout->printRowsOnly,