Taglib documentation for tag mak:option#
Description#
By default, for pointer and set fields, mak:input will show a choser (selector) that includes the title of all possible options, ordered by that title. To change that behavior, the mak:input can include one or more mak:option. Options can be repeated using mak:list, c:foreach, and in general can appear inside any other tag. Text inside mak:option will become an option title. The value attribute will become the option. Text inside the mak:input that is not inside a mak:option amd is not blank (whitespace) will be assumed to separate groups of options and will be rendered. For options that render HTML SELECTs, this is only accepted for multiple SELECTs which will create several SELECT boxes of equal size, one for each option group.
If mak:option doesn't have a value indicated, it will produce a nil option. Such nil options will be ignored at form submission.
If an option value appears many times it will only be shown the first time it occurs.

Attributes#
Name | Required | Runtime expression | Description | Comments |
---|---|---|---|---|
value | false | false | Value of the option, can be an MQL expression or a $attribute
.![]() |
If not indicated, nil (null option) is default. null option can be also marked as "nil" or "" (except for char types, where it is a valid option)
.![]() |
selected | false | false | Whether this option is selected or not
.![]() |
False by default
.![]() |
disabled | false | false | Whether the option will be disabled
.![]() |
. ![]() |
See also#
Examples#
<mak:object from="company.Project p" where="p=$project"> <mak:editForm object="p"> <mak:input name="leader"> <mak:option>Please choose:</mak:option> <mak:list from="company.Employee e" where="e.gender=10" > <mak:option value="e"><mak:value expr="e.name"/> <mak:value expr="e.surname"/></mak:option> </mak:list> <mak:option> -------- separator----------</mak:option> <mak:list from="company.Employee e" where="e.gender=20" > <mak:option value="e"><mak:value expr="e.name"/> <mak:value expr="e.surname"/></mak:option> </mak:list> </mak:input> </mak:editForm> </mak:object>
