Rose::HTMLx::Form::Field::Boolean - extend RHTMLO RadioButtonGroup


Rose-HTMLx-Form-Field-Boolean documentation Contained in the Rose-HTMLx-Form-Field-Boolean distribution.

Index


Code Index:

NAME

Top

Rose::HTMLx::Form::Field::Boolean - extend RHTMLO RadioButtonGroup

SYNOPSIS

Top

 # see Rose::HTML::Form::Field::RadioButtonGroup

DESCRIPTION

Top

This Field class is for boolean-type fields. The default labels are True and False, paired with values 1 and 0 respectively.

METHODS

Top

Only new or overridden methods are documented here.

init

Sets up the object.

xhtml_field

Returns the radio button pair within a <div class="boolean_group"> tagset.

AUTHOR

Top

Peter Karman, <karman at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-rose-htmlx-form-field-boolean at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Rose-HTMLx-Form-Field-Boolean. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Rose::HTMLx::Form::Field::Boolean

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Rose-HTMLx-Form-Field-Boolean

* CPAN Ratings

http://cpanratings.perl.org/d/Rose-HTMLx-Form-Field-Boolean

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Rose-HTMLx-Form-Field-Boolean

* Search CPAN

http://search.cpan.org/dist/Rose-HTMLx-Form-Field-Boolean

ACKNOWLEDGEMENTS

Top

The Minnesota Supercomputing Institute http://www.msi.umn.edu/ sponsored the development of this software.

COPYRIGHT & LICENSE

Top


Rose-HTMLx-Form-Field-Boolean documentation Contained in the Rose-HTMLx-Form-Field-Boolean distribution.
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';

sub _item_class {'Rose::HTMLx::Form::Field::RadioButtonBoolean'}

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;
}

sub xhtml_field {
    my ($self) = shift;
    my $sep = ( $self->linebreak ) ? $self->xhtml_linebreak : ' ';
    return '<div class="boolean_group">'
        . join( $sep, map { $_->xhtml_field } $self->items )
        . '</div>';
}

1;