Class: Aurita::GUI::Hidden_Field
- Inherits:
-
Form_Field
- Object
- Element
- Form_Field
- Aurita::GUI::Hidden_Field
- Defined in:
- lib/aurita-gui/form/hidden_field.rb
Overview
Usage:
i = Hidden_Field.new(:name => :description,
:label => 'Description',
:value => 'Lorem ipsum dolor')
Tag attributes like onclick, onchange, class etc. can be set, but will either be ignored or have no effect.
Instance Attribute Summary
Attributes inherited from Form_Field
Attributes inherited from Element
#attrib, #content, #parent, #tag, #type
Instance Method Summary collapse
- #element ⇒ Object
-
#initialize(params, &block) ⇒ Hidden_Field
constructor
A new instance of Hidden_Field.
- #readonly_element ⇒ Object
Methods inherited from Form_Field
#disable!, #editable!, #enable!, #readonly!, #readonly?, #to_s
Methods inherited from Element
#+, #[], #[]=, #clear_floating, #dom_id, #dom_id=, #each, #empty?, #id, #id=, #length, #method_missing, #string, #to_ary
Constructor Details
#initialize(params, &block) ⇒ Hidden_Field
Returns a new instance of Hidden_Field.
18 19 20 21 22 23 24 25 |
# File 'lib/aurita-gui/form/hidden_field.rb', line 18 def initialize(params, &block) params[:tag] = :input params[:type] = :hidden if block_given? then params[:value] = yield end super(params) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Aurita::GUI::Element
Instance Method Details
#element ⇒ Object
26 27 28 |
# File 'lib/aurita-gui/form/hidden_field.rb', line 26 def element HTML.input(@attrib) end |
#readonly_element ⇒ Object
29 30 31 |
# File 'lib/aurita-gui/form/hidden_field.rb', line 29 def readonly_element element() end |