CGI-Test
view release on metacpan or search on metacpan
lib/CGI/Test/Form/Widget.pm view on Meta::CPAN
=head2 Attribute Setting
=over 4
=item C<set_value> I<new_value>
Change the C<value> attribute to I<new_value>.
The widget must not be C<is_read_only> nor C<is_disabled>.
=back
=head2 Widget Modification Predicates
Those predicates may be used to determine whether it is possible to
change the value of a widget from the user interface.
=over 4
=item C<is_disabled>
When I<true>, the widget is disabled, i.e. not available for editing.
It would typically appear as being I<grayed out> within a browser.
This predicate is not architecturally defined: a widget may or may not
be marked as disabled in HTML via a suitable attribute.
=item C<is_mutable> [I<warn_flag>]
Test whether widget can change value. Returns I<false> when
the widget C<is_read_only> or C<is_disabled>.
When the optional I<warn_flag> is true, C<carp> is called
to emit a warning from the perspective of the caller.
=item C<is_read_only>
When I<false>, the C<value> parameter can be changed with C<set_value>.
This is an architecturally defined predicate, i.e. its value depends only
on the widget type.
=back
=head2 Widget Classification Predicates
Those predicates may be used to determine the overall widget type.
The classification is rather high level and only helps determining
the kind of calls that may be used on a given widget object.
=over 4
=item C<is_box>
Returns true for radio buttons and checkboxes.
=item C<is_button>
Returns true for all buttons that are not boxes.
=item C<is_file>
Returns true for a I<file upload> widget, which allows file selection.
=item C<is_hidden>
Returns true for hidden fields, which have no graphical representation
by definition.
=item C<is_input>
Returns true for all input fields, where the user can type text.
=item C<is_menu>
Returns true for popup menus and scrolling lists.
=back
=head2 Miscellaneous Features
Although documented, those features are more targetted for internal use...
=over 4
=item C<delete>
Breaks circular references.
This is normally done by the C<delete> routine on the enclosing form.
=item C<is_submitable>
Returns I<true> when the name/value tupple of this widget need to be
part of the submitted parameters. The rules for determining the submitable
nature of a widget vary depending on the widget type.
=item C<reset_state>
Reset the widget's C<value> to the one it had initially. Invoked internally
when a reset button is pressed.
=item C<submit_tuples>
For submitable widgets, return the list of (name => value) tupples that
should be part of the submitted data. Widgets like scrolling list may return
more than one tuple.
This routine is invoked to compute the parameter list that must be sent back
when pressing a submit button.
=back
=head1 AUTHORS
The original author is Raphael Manfredi.
Steven Hilton was long time maintainer of this module.
Current maintainer is Alexander Tokarev F<E<lt>tokarev@cpan.orgE<gt>>.
=head1 SEE ALSO
CGI::Test::Form(3),
( run in 0.785 second using v1.01-cache-2.11-cpan-b16cb0d3907 )