.\" This man page is automatically generated using .\" kayadoc2man from the Kaya development tools and the -xmldocs compile .\" option. Editing it directly is not encouraged. .\" It is under the same license as the source .k file that it was .\" generated from. .TH "HTMLDocument.addOptionList" "3kaya" "August 2014" "Kaya" "Kaya module reference" .SH "NAME" HTMLDocument::addOptionList \- Adds a set of checkboxes or radio buttons .SH "SYNOPSIS" .B ElementTree addOptionList( \fIElementTree parent, String legend, String iname, [SelectOption] options, Bool allowmultiple=true\fP .B ")" .SH "ARGUMENTS" .PP .B "parent" The parent element .PP .B "legend" The legend for the fieldset grouping the options .PP .B "iname" The name of the option controls. Remember that names starting with "kaya_" may be used by the Kaya standard library and should not be used directly by applications. .PP .B "options" The options to select from .PP .B "allowmultiple" This parameter is optional and defaults to \fBtrue \fP , which generates the option list as a set of checkboxes. If it is explicitly set to \fBfalse \fP then radio buttons are used instead. .SH "DESCRIPTION" .PP Adds a set of checkboxes or radio buttons to a form. The meaning of the parameters is very similar or identical to the similar parameters for .B "HTMLDocument.addLabelledSelect"(3kaya) , but the appearance is very different. If the number of options is not large, this is generally considerably easier to use than a selection drop-down, although it does take up much more screen space. .PP When using this function to generate radio buttons, you should ensure that one of the options is initially selected, as browser behaviour when no option is selected is variable and often causes problems. You may need to add a "no option selected" radio button for initial selection in some circumstances. .IP "" -4 options = [ SelectOption("Express delivery","1",true), SelectOption("Standard delivery","2",false), SelectOption("Slow delivery","3",false) ]; sel = addLabelledSelect(fieldset,"Select a delivery speed","choice", options,false); /* // produces
Select a delivery speed
*/ // exact markup may vary slightly to keep IDs unique in the document .SH "AUTHORS" Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/ .SH LICENSE The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (version 2.1 or any later version) as published by the Free Software Foundation. .SH "RELATED" .PD 0 .PP .B "HTMLDocument.SelectOption"(3kaya) .PP .B "HTMLDocument.addLabelledSelect"(3kaya) .PP .B "HTMLDocument.addOption"(3kaya) .PD 0.4v