.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" 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 .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "HTML::Widget::Element::Select 3pm" .TH HTML::Widget::Element::Select 3pm "2018-02-25" "perl v5.26.1" "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" HTML::Widget::Element::Select \- Select Element .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 7 \& my $e = $widget\->element( \*(AqSelect\*(Aq, \*(Aqfoo\*(Aq ); \& $e\->comment(\*(Aq(Required)\*(Aq); \& $e\->label(\*(AqFoo\*(Aq); \& $e\->size(23); \& $e\->options( foo => \*(AqFoo\*(Aq, bar => \*(AqBar\*(Aq ); \& $e\->selected(qw/foo bar/); \& $e\->constrain_options(1); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Select Element. .PP As of version 1.09, an In constraint is no longer automatically added to Select elements. Use \*(L"constrain_options\*(R" to provide this functionality. .SH "METHODS" .IX Header "METHODS" .SS "comment" .IX Subsection "comment" Add a comment to this Element's label. .SS "label" .IX Subsection "label" This label will be placed next to your Element. .SS "size" .IX Subsection "size" If set to 1, the select element is displayed as a pop-up menu, otherwise the element is displayed as a list box, with the size determining the display height in rows. The default size is 1. .SS "multiple" .IX Subsection "multiple" .Vb 1 \& $widget\->element( \*(AqSelect\*(Aq, \*(Aqfoo\*(Aq )\->multiple( 1 ); .Ve .PP If the multiple attribute is set, the select element is rendered as a list box, and the user may select multiple options. .PP If the size is not set, the default size (height) is the number of elements. If the size is set to 1, the element is rendered as a pop-up menu. .SS "options" .IX Subsection "options" A list of options in key => value format. Each key is the unique id of an option tag, and its corresponding value is the text displayed in the element. .SS "selected" .IX Subsection "selected" .SS "value" .IX Subsection "value" A list of keys (unique option ids) which will be pre-set to \*(L"selected\*(R". Can also be addressed as value for consistency with the other elements .PP \&\*(L"value\*(R" is an alias for \*(L"selected\*(R". .SS "constrain_options" .IX Subsection "constrain_options" .SS "constrain_values" .IX Subsection "constrain_values" If true, an In constraint will automatically be added to the widget, using the key names from \*(L"options\*(R". .PP \&\*(L"constrain_values\*(R" is an alias for \*(L"constrain_options\*(R". .SS "retain_default" .IX Subsection "retain_default" If true, overrides the default behaviour, so that after a field is missing from the form submission, the xml output will contain the default value, rather than be empty. .SS "prepare" .IX Subsection "prepare" .SS "process" .IX Subsection "process" .SS "containerize" .IX Subsection "containerize" .SH "SEE ALSO" .IX Header "SEE ALSO" HTML::Widget::Element .SH "AUTHOR" .IX Header "AUTHOR" Sebastian Riedel, \f(CW\*(C`sri@oook.de\*(C'\fR .SH "LICENSE" .IX Header "LICENSE" This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.