package Rose::HTMLx::Form::Field::Boolean;
use warnings;
use strict;
use Rose::HTMLx::Form::Field::RadioButtonBoolean;
use base qw( Rose::HTML::Form::Field::RadioButtonGroup );
our $VERSION = '0.03';
=head1 NAME
Rose::HTMLx::Form::Field::Boolean - extend RHTMLO RadioButtonGroup
=cut
=head1 SYNOPSIS
# see Rose::HTML::Form::Field::RadioButtonGroup
=head1 DESCRIPTION
This Field class is for boolean-type fields. The default labels are True
and False, paired with values 1 and 0 respectively.
=head1 METHODS
Only new or overridden methods are documented here.
=cut
sub _item_class {'Rose::HTMLx::Form::Field::RadioButtonBoolean'}
=head2 init
Sets up the object.
=cut
sub init {
my $self = shift;
$self->SUPER::init(@_); # MUST do this first
$self->xhtml_linebreak('');
$self->radio_buttons( [ '1', '0' ] );
$self->labels( { 1 => 'True', 0 => 'False' } );
return $self;
}
=head2 xhtml_field
Returns the radio button pair within a
tagset.
=cut
sub xhtml_field {
my ($self) = shift;
my $sep = ( $self->linebreak ) ? $self->xhtml_linebreak : ' ';
return '
'
. join( $sep, map { $_->xhtml_field } $self->items )
. '
';
}
=head1 AUTHOR
Peter Karman, C<<
>>
=head1 BUGS
Please report any bugs or feature requests to
C, or through the web interface at
L.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Rose::HTMLx::Form::Field::Boolean
You can also look for information at:
=over 4
=item * AnnoCPAN: Annotated CPAN documentation
L
=item * CPAN Ratings
L
=item * RT: CPAN's request tracker
L
=item * Search CPAN
L
=back
=head1 ACKNOWLEDGEMENTS
The Minnesota Supercomputing Institute C<< http://www.msi.umn.edu/ >>
sponsored the development of this software.
=head1 COPYRIGHT & LICENSE
Copyright 2007 by the Regents of the University of Minnesota.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut
1;