.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "CGI::Test::Form::Widget::Button 3pm" .TH CGI::Test::Form::Widget::Button 3pm "2022-06-10" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" CGI::Test::Form::Widget::Button \- Abstract representation of a button .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # Inherits from CGI::Test::Form::Widget .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class is the abstract representation of a button, i.e. a submit button, an image button, a reset button or a plain button. .PP Pressing a button is achieved by calling \f(CW\*(C`press()\*(C'\fR on it, which returns a new page, as a \f(CW\*(C`CGI::Test::Page\*(C'\fR object, or \f(CW\*(C`undef\*(C'\fR if pressing had no round-trip effect. .SH "INTERFACE" .IX Header "INTERFACE" The interface is the same as the one described in CGI::Test::Form::Widget, with the following additions: .SS "Attributes" .IX Subsection "Attributes" .ie n .IP """is_pressed""" 4 .el .IP "\f(CWis_pressed\fR" 4 .IX Item "is_pressed" True when the button is pressed. .SS "Attribute Setting" .IX Subsection "Attribute Setting" .ie n .IP """press""" 4 .el .IP "\f(CWpress\fR" 4 .IX Item "press" Press the button, setting \f(CW\*(C`is_pressed\*(C'\fR to true. .Sp If the button is a reset button (\f(CW\*(C`is_reset\*(C'\fR is true), all widgets are reset to their initial state, and \f(CW\*(C`undef\*(C'\fR is returned. .Sp If the button is a submit button (\f(CW\*(C`is_submit\*(C'\fR is true), then a \s-1GET/POST\s0 request is issued as appropriate and the reply is made available through a \f(CW\*(C`CGI::Test::Page\*(C'\fR object. .Sp Otherwise, the button pressing is ignored, a warning is issued from the perspective of the caller, via \f(CW\*(C`carp\*(C'\fR, and \f(CW\*(C`undef\*(C'\fR is returned. .SS "Widget Classification Predicates" .IX Subsection "Widget Classification Predicates" There is an additional set of predicates to distinguish between the various buttons: .ie n .IP """is_plain""" 4 .el .IP "\f(CWis_plain\fR" 4 .IX Item "is_plain" Returns \fItrue\fR for a plain button, i.e. a button that has no submit/reset effects. Usually, those buttons are linked to a script, but \f(CW\*(C`CGI::Test\*(C'\fR does not support scripting yet. .ie n .IP """is_reset""" 4 .el .IP "\f(CWis_reset\fR" 4 .IX Item "is_reset" Returns \fItrue\fR for reset buttons. .ie n .IP """is_submit""" 4 .el .IP "\f(CWis_submit\fR" 4 .IX Item "is_submit" Returns \fItrue\fR for submit buttons, whether they are really shown as buttons or as images. A submit button will cause an \s-1HTTP\s0 request to be issued in response to its being pressed. .SS "Miscellaneous Features" .IX Subsection "Miscellaneous Features" Although documented, those features are more targetted for internal use... .ie n .IP """set_is_pressed"" \fIflag\fR" 4 .el .IP "\f(CWset_is_pressed\fR \fIflag\fR" 4 .IX Item "set_is_pressed flag" Change the pressed status of the button, to the value of \fIflag\fR. It does not raise any other side effect, like submitting an \s-1HTTP\s0 request if the button is a submit button. .Sp You should probably use the \f(CW\*(C`press\*(C'\fR convenience routine instead of calling this feature directly. .SH "AUTHORS" .IX Header "AUTHORS" The original author is Raphael Manfredi. .PP Steven Hilton was long time maintainer of this module. .PP Current maintainer is Alexander Tokarev \fI\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBCGI::Test::Form::Widget\fR\|(3), \&\fBCGI::Test::Form::Widget::Button::Image\fR\|(3), \&\fBCGI::Test::Form::Widget::Button::Plain\fR\|(3), \&\fBCGI::Test::Form::Widget::Button::Reset\fR\|(3), \&\fBCGI::Test::Form::Widget::Button::Submit\fR\|(3).