# Copyright (c) 2001-2009 bivio Software, Inc. All Rights reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: YesNo.pm,v 2.7 2011/08/12 15:57:29 moeller Exp $ package Bivio::UI::HTML::Widget::YesNo; use strict; use Bivio::Base 'Widget.Join'; use Bivio::UI::ViewLanguageAUTOLOAD; # Displays a Boolean field as Yes/No radios. our($VERSION) = sprintf('%d.%02d', q$Revision: 2.7 $ =~ /\d+/g); sub initialize { my($self) = @_; return if $self->unsafe_get('values'); $self->put(values => [ Radio($self->get('field'), 1, 'Yes'), vs_blank_cell(3), Radio($self->get('field'), 0, 'No'), ]); return shift->SUPER::initialize(@_); } 1;