Class: WAB::UI::Create

Inherits:
View show all
Defined in:
lib/wab/ui/create.rb

Overview

An object create display.

Instance Attribute Summary

Attributes inherited from Display

#display_class, #kind, #name, #template, #transitions

Instance Method Summary collapse

Methods inherited from View

#append_fields, #spec

Methods inherited from Display

#spec

Constructor Details

#initialize(kind, id, template, transitions) ⇒ Create

Create an instance that will generate the HTML for a display.



9
10
11
# File 'lib/wab/ui/create.rb', line 9

def initialize(kind, id, template, transitions)
  super(kind, id, template, transitions, 'ui.Create')
end

Instance Method Details

#htmlObject

Returns the HTML for a display.



14
15
16
17
18
19
20
21
# File 'lib/wab/ui/create.rb', line 14

def html
  html = %{<div class="obj-form-frame"><table class="obj-form">}
  html = append_fields(html, @name, template, false)
  html << '</table>'
  html << %{<div class="btn" id="#{@name}.save_button"><span>Save</span></div>}
  html << %{<div class="btn" style="float:right;" id="#{@name}.cancel_button"><span>Cancel</span></div>}
  html << '</div>'
end