Class ::xowiki::formfield::select

::xowiki::formfield::select[i] create ... \
           [ -multiple (default "false") ]

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xowiki::formfield::enumeration[i]
  • subclass: ::xowiki::formfield::candidate_box_select[i], ::xowiki::formfield::month[i], ::xowiki::formfield::HH24[i], ::xowiki::formfield::class[i], ::xowiki::formfield::iprange[i], ::xowiki::formfield::security_policy[i], ::xowiki::formfield::MM[i], ::xowiki::formfield::MI[i], ::xowiki::formfield::grading_scheme[i], ::xowiki::formfield::DD[i], ::xowiki::formfield::mon[i], ::xowiki::formfield::bootstrap-select[i], ::xowiki::formfield::reorder_box[i]
::xotcl::Class create ::xowiki::formfield::select \
     -superclass ::xowiki::formfield::enumeration

Methods (to be applied on instances)

  • 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
        #:msg "lsearch {$value} $rep ==> [lsearch $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