Module: Vapir::CheckBox
- Extended by:
- ElementHelper
- Includes:
- RadioCheckBoxCommon
- Defined in:
- lib/vapir-common/elements/elements.rb
Instance Method Summary collapse
-
#set(state = true, options = {}) ⇒ Object
Checks this check box, or clears (defaults to setting if no argument is given) Raises ObjectDisabledException exception if element is disabled.
Methods included from ElementHelper
add_specifier, container_collection_method, container_single_method, included
Methods included from ElementClassAndModuleMethods
#add_container_method_extra_args, #all_dom_attr_aliases, #all_dom_attrs, #class_array_append, #class_array_get, #class_hash_get, #class_hash_merge, #container_collection_methods, #container_method_extra_args, #container_single_methods, #default_how, #dom_attr, #dom_attr_locate_alias, #dom_function, #dom_setter, #element_collection, #factory, #inspect_these, #inspect_this_if, #parent_element_module, #set_or_get_class_var, #specifiers
Methods included from RadioCheckBoxCommon
Instance Method Details
#set(state = true, options = {}) ⇒ Object
Checks this check box, or clears (defaults to setting if no argument is given) Raises ObjectDisabledException exception if element is disabled.
takes options:
-
:highlight => true/false (defaults to true)
-
:wait => true/false (defaults to true)
529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 |
# File 'lib/vapir-common/elements/elements.rb', line 529 def set(state=true, ={}) =(, :highlight => true, :wait => config.wait) with_highlight() do assert_enabled if checked!=state if browser_class.name != 'Vapir::Firefox' # compare by name to not trigger autoload or raise NameError if not loaded # in firefox, firing the onclick event changes the state. in IE, it doesn't, so do that first # todo/fix: this is browser-specific stuff, shouldn't it be in the browser-specific class? element_object.checked=state end handling_existence_failure { fire_event(:onclick, ) } # sometimes previous actions can cause self to stop existing handling_existence_failure { fire_event(:onchange, ) } end wait if [:wait] end return self end |