Class: Ext::Field

Inherits:
Component show all
Defined in:
lib/selenium-extjs/component/Field.rb

Direct Known Subclasses

Combo

Instance Attribute Summary

Attributes inherited from Component

#parent

Instance Method Summary collapse

Methods inherited from Component

#getId, #highlight, #init_component, #initialize, #method_missing, #node, #selector, #wait_for_ajax

Constructor Details

This class inherits a constructor from Ext::Component

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ext::Component

Instance Method Details

#blurObject



15
16
17
# File 'lib/selenium-extjs/component/Field.rb', line 15

def blur
  @selenium.fire_event(@id, "blur")
end

#valueObject

user valid? def has_error?

# using Ext.JS
@selenium.get_eval("window.Ext.getCmp('#{@id}').isValid()") != "true"

end



25
26
27
28
29
30
# File 'lib/selenium-extjs/component/Field.rb', line 25

def value
  # xpath or Ext?
  # TODO: get more information from field (textarea or input[type=text])
  @selenium.get_value(@id) #{}"//div[@id='#{@id}']//input")
  # return @selenium.get_eval("window.Ext.getCmp('#{@id}').getValue()");
end

#value=(v) ⇒ Object

attr_reader :name

 def init_component()
    @name = @selenium.get_eval("window.Ext.getCmp('#{@id}').getName()");
  end


10
11
12
13
# File 'lib/selenium-extjs/component/Field.rb', line 10

def value= (v)
  @selenium.type(@id, v)
  blur
end