
CGI::Test::Form::Widget::Box - Abstract representation of a tickable box

# Inherits from CGI::Test::Form::Widget

This class is the abstract representation of a tickable box, i.e. a radio button or a checkbox.
To simulate user checking or un-checking on a box, use the check() and uncheck() routines, as described below.

The interface is the same as the one described in CGI::Test::Form::Widget, with the following additions:
groupThe CGI::Test::Form::Group object which holds all the groups of the same widget type.
group_listThe list of widgets belonging to the same group as we do.
is_checkedTrue when the box is checked, i.e. marked with a tick.
checkCheck the box, by ticking it.
check_tagged tagThis may be called on any box, and it will locate the box whose value attribute is tag within the group_list, and then check it.
If the specified tag is not found, the caller will get a warning via logcarp.
uncheckUncheck the box, by removing its ticking mark. It is not possible to do this on a radio button: you must check another radio button of the same group instead.
uncheck_tagged tagThis may be called on any box, and it will locate the box whose value attribute is tag within the group_list, and then remove its ticking mark. It is not possible to do this on a radio button, as explained in uncheck above.
If the specified tag is not found, the caller will get a warning via logcarp.
There is an additional predicate to distinguish between a checkbox and a radio button:
is_radioReturns true for a radio button.
is_standaloneReturns true if the box is the sole member of its group.
Normally only useful for checkboxes: a standalone radio button, although perfectly legal, would always remain in the checked state, and therefore not be especially interesting...
Although documented, those features are more targetted for internal use...
set_is_checked flagChange the checked status. Radio buttons can only be checked, i.e. the flag must be true: all other radio buttons in the same group are immediately unchecked.
You should use the check and uncheck convenience routines instead of calling this feature.

Raphael Manfredi <Raphael_Manfredi@pobox.com>

CGI::Test::Form::Widget(3), CGI::Test::Form::Widget::Box::Radio(3), CGI::Test::Form::Widget::Box::Check(3).