Skip to content

Commit

Permalink
Item11928: revert Item11666 1.1 branch change to default radio and ch…
Browse files Browse the repository at this point in the history
…eckboxes

This reverts commit 3d5b4dbdf515ef1024be0f9af334406cd894d1cf.

git-svn-id: http://svn.foswiki.org/branches/Release01x01@15653 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Oct 22, 2012
1 parent 3bcbaeb commit 21ef70b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion core/lib/Foswiki/Form.pm
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@ sub renderForEdit {
my $extra = ''; # extras on col 0

unless ( defined($value) ) {

my $dv = $fieldDef->getDefaultValue($value);
if ( defined($dv) ) {
$dv = $topicObject->expandMacros($dv);
Expand Down
6 changes: 0 additions & 6 deletions core/lib/Foswiki/Form/Radio.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ sub finish {
undef $this->{valueMap};
}

# From System.DataForms, "The first item in the list for a select or
# radio type is the default item."
sub getDefaultValue {
return shift->getOptions()->[0];
}

sub getOptions {
my $this = shift;

Expand Down
7 changes: 4 additions & 3 deletions core/lib/Foswiki/Form/Select.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ sub new {
=begin TML
---++ getDefaultValue() -> $value
From System.DataForms, "The first item in the list for a select or
radio type is the default item."
The default for a select is always the empty string, as there is no way in
Foswiki form definitions to indicate selected values. This defers the decision
on a value to the browser.
=cut

sub getDefaultValue {
return shift->getOptions()->[0];
return '';
}

sub getOptions {
Expand Down

0 comments on commit 21ef70b

Please sign in to comment.