Class: HtmlGrid::NamedComponent
- Defined in:
- lib/htmlgrid/namedcomponent.rb
Direct Known Subclasses
AbstractSelect, BooleanValue, DateValue, Image, Input, InputFile, Link, SimpleLabel, StaticInput, Text, Value
Constant Summary
Constants inherited from Component
Component::CSS_CLASS, Component::CSS_ID, Component::HTML_ATTRIBUTES, Component::HTTP_HEADERS, Component::LABEL
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Component
#attributes, #dojo_tooltip, #label, #model, #value
Instance Method Summary collapse
- #data_origin ⇒ Object
- #error? ⇒ Boolean
- #init ⇒ Object
-
#initialize(name, model, session, container = nil) ⇒ NamedComponent
constructor
A new instance of NamedComponent.
Methods inherited from Component
#_to_html, #autofill?, #css_class, #css_class=, #css_id, #css_id=, #dojo_dynamic_html, #dojo_parse_on_load, #dojo_tag, #dojo_title=, #dynamic_html, #escape, #escape_symbols, #formname, #http_headers, #label?, #onclick=, #onload=, #onsubmit=, #set_attribute, #tabindex=, #to_html
Constructor Details
#initialize(name, model, session, container = nil) ⇒ NamedComponent
Returns a new instance of NamedComponent.
32 33 34 35 36 |
# File 'lib/htmlgrid/namedcomponent.rb', line 32 def initialize(name, model, session, container = nil) @name = name super(model, session, container) @attributes["name"] = @name.to_s end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/htmlgrid/namedcomponent.rb', line 31 def name @name end |
Instance Method Details
#data_origin ⇒ Object
43 44 45 46 47 |
# File 'lib/htmlgrid/namedcomponent.rb', line 43 def data_origin if @model.respond_to?(:data_origin) @model.data_origin(@name) end end |
#error? ⇒ Boolean
49 50 51 52 53 |
# File 'lib/htmlgrid/namedcomponent.rb', line 49 def error? if @model.respond_to?(:error?) @model.error?(@name) end end |
#init ⇒ Object
38 39 40 41 |
# File 'lib/htmlgrid/namedcomponent.rb', line 38 def init super @attributes.update(@lookandfeel.attributes(@name)) if @lookandfeel end |