Class: Lapillus::RemotePanel
- Defined in:
- lib/lapillus/containers.rb
Overview
TODO: whats in a name
Instance Attribute Summary
Attributes inherited from Container
Attributes inherited from Component
#behaviours, #identifier, #model, #property, #visible
Instance Method Summary collapse
-
#default_htmlfile ⇒ Object
duplicate with methods in webpage!.
-
#render_2(template = default_htmlfile) ⇒ Object
(also: #render)
duplicate with webpage!.
- #render_children(visitor, template_element) ⇒ Object
Methods inherited from Container
#[], #add, add_component, #component, fileuploadfield, image, #initialize, label, listview, panel, password_textfield, #post, textarea, textfield
Methods inherited from Component
#add_behaviour, #behaviour, #has_behaviour?, #has_model?, #has_parent?, #initialize, #parent, #path, #response_page=, #session, #value, #webpage
Methods inherited from RenderableComponent
#initialize, #on_render, #render_behaviours, #render_component, #render_container, #render_to_element, #visible?
Constructor Details
This class inherits a constructor from Lapillus::Container
Instance Method Details
#default_htmlfile ⇒ Object
duplicate with methods in webpage!
213 214 215 216 |
# File 'lib/lapillus/containers.rb', line 213 def default_htmlfile htmlfile = "html/" + self.class.to_s + ".html" File.new( htmlfile ) end |
#render_2(template = default_htmlfile) ⇒ Object Also known as: render
duplicate with webpage!
203 204 205 206 207 208 209 |
# File 'lib/lapillus/containers.rb', line 203 def render_2(template=default_htmlfile) doc = REXML::Document.new template root_element = doc.root visitor = HtmlVisitor.new(self) root_element.accept(visitor) return doc.doctype.to_s + visitor.container_output.root.to_s.gsub(''',"'").gsub('"','"') end |
#render_children(visitor, template_element) ⇒ Object
194 195 196 197 198 199 200 |
# File 'lib/lapillus/containers.rb', line 194 def render_children(visitor, template_element) doc = REXML::Document.new default_htmlfile root_node = doc.root fragment = REXML::XPath.first( root_node, "//body") raise "Body element not found!" if fragment == nil super(visitor, fragment) end |