Class: Lapillus::Fragment
- Defined in:
- lib/lapillus/containers.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Container
Attributes inherited from Component
#behaviours, #identifier, #model, #property, #visible
Instance Method Summary collapse
-
#initialize(id, fragment_id, options = {}) ⇒ Fragment
constructor
A new instance of Fragment.
- #render_children(visitor, template_element) ⇒ Object
Methods inherited from Container
#[], #add, add_component, #component, fileuploadfield, image, label, listview, panel, password_textfield, #post, textarea, textfield
Methods inherited from Component
#add_behaviour, #behaviour, #has_behaviour?, #has_model?, #has_parent?, #parent, #path, #response_page=, #session, #value, #webpage
Methods inherited from RenderableComponent
#on_render, #render_behaviours, #render_component, #render_container, #render_to_element, #visible?
Constructor Details
#initialize(id, fragment_id, options = {}) ⇒ Fragment
Returns a new instance of Fragment.
164 165 166 167 |
# File 'lib/lapillus/containers.rb', line 164 def initialize(id, fragment_id, ={}) super(id, ) @fragment_id = fragment_id end |
Instance Method Details
#render_children(visitor, template_element) ⇒ Object
169 170 171 172 173 174 |
# File 'lib/lapillus/containers.rb', line 169 def render_children(visitor, template_element) root_node = template_element.root fragment = REXML::XPath.first( root_node, "//*[@lapillus:id=\"#{@fragment_id}\"]" ) raise "Fragment with identifier "+@fragment_id+" not found!" if fragment == nil super(visitor, fragment) end |