- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::formfield::boolean_image
::xowiki::formfield::boolean_image create ... \
[ -CSSclass (default "img_boolean") ] \
[ -default (default "t") ] \
[ -f_img_url (default "/resources/xowiki/examples/check_falsch.png") ] \
[ -t_img_url (default "/resources/xowiki/examples/check_richtig.png") ]
Class Relations
::xotcl::Class create ::xowiki::formfield::boolean_image \ -superclass ::xowiki::formfield::FormFieldMethods (to be applied on instances)
CSSclass (setter)
default (setter)
f_img_url (setter)
initialize (scripted)
:type hidden set :widget_type boolean(hidden)render_input (scripted)
set title [expr {[info exists :__render_help_text_as_title_attr] ? ${:help_text} : ""}] ::html::img -title $title -class ${:CSSclass} -src [expr {[:value] ? ${:t_img_url} : ${:f_img_url}}] -id ${:id}-image template::add_event_listener -id ${:id}-image -script [subst {toggle_img_boolean(this,'${:t_img_url}','${:f_img_url}');}] ::html::input -type hidden -name ${:name} -value [:value] ::xo::Page requireJS { function toggle_img_boolean (element,t_img_url,f_img_url) { var input = $(element).next(); var state = input.val()== "t"; if (state) { input.val('f'); $(element).attr('src',f_img_url); } else { input.val('t'); $(element).attr('src',t_img_url); } } }t_img_url (setter)
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables