Class ::xowiki::formfield::select
::xowiki::formfield::select
create ... \
[ -CSSclass (default "form-select") ]
Class Relations
- class: ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- superclass: ::xowiki::formfield::enumeration
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- subclass: ::xowiki::formfield::month
, ::xowiki::formfield::HH24
, ::xowiki::formfield::iprange
, ::xowiki::formfield::candidate_box_select
, ::xowiki::formfield::security_policy
, ::xowiki::formfield::MM
, ::xowiki::formfield::MI
, ::xowiki::formfield::DD
, ::xowiki::formfield::bootstrap-select
, ::xowiki::formfield::grading_scheme
, ::xowiki::formfield::reorder_box
, ::xowiki::formfield::class
, ::xowiki::formfield::mon![[i]](/resources/acs-subsite/ZoomIn16.gif)
::xotcl::Class create ::xowiki::formfield::select \
-superclass ::xowiki::formfield::enumeration
Methods (to be applied on instances)
CSSclass (setter)
initialize (scripted)
set :widget_type text(select)
next
if {![info exists :options]} {set :options [list]}multiple (setter)
render_input (scripted)
set value [:value]
set atts [:get_attributes id name {CSSclass class}]
set disabled_p [:is_disabled]
if {$disabled_p} {lappend atts disabled true}
if {${:multiple}} {lappend atts multiple ${:multiple}}
if {!${:required}} {
set :options [linsert ${:options} 0 [list "--" ""]]
}
::html::select $atts {
foreach o ${:options} {
lassign $o label rep
set atts {}
if {$disabled_p} {
lappend atts disabled true
}
lappend atts value $rep
if {[string is list -strict $value] && $rep in $value} {
lappend atts selected selected
}
::html::option $atts {::html::t $label}
::html::t \n
}
}
:handle_transmit_always $value