Class: ODDB::View::SuggestAddressForm

Inherits:
Form
  • Object
show all
Includes:
HtmlGrid::ErrorMessage
Defined in:
src/view/suggest_address.rb

Constant Summary

COMPONENTS =
{
  [0,0] =>  :address_type,
  [3,1] =>  'suggest_addr_email',
  [0,1] =>  :title, 
  [2,2] =>  :email,
  [0,2] =>  :name, 
  [0,3] =>  :additional_lines, 
  [2,3] =>  :address_message,
  [0,4] =>  :address, 
  [0,5] =>  :location,
  [0,6] =>  :canton,
  [0,7] =>  :fon,
  [0,8] =>  :fax,
  [1,9] =>  'explain_fon',
  [0,10]  => :email_suggestion,
  [1,11]  => :submit,
}
CSS_MAP =
{
  [0,0,4,12]  => 'list', 
  [0,3] => 'list top',
  [1,9] => 'list small',
  [2,3] => 'list top',
}
COMPONENT_CSS_MAP =
{
  [0,0,4,11]  => 'standard', 
}
EVENT =
:address_send
LABELS =
true
LEGACY_INTERFACE =
false
SYMBOL_MAP =
{
  :address_type       => HtmlGrid::Select,
  :canton             => HtmlGrid::Select,
  :email              => HtmlGrid::InputText,
}
LOOKANDFEEL_MAP =
{
  :message => :address_message
}

Constants included from FormMethods

ACCEPT_CHARSET, DEFAULT_CLASS, EVENT

Instance Method Summary (collapse)

Methods included from FormMethods

#delete_item, #delete_item_warn, #get_event_button, #post_event_button

Instance Method Details

- (Object) additional_lines(model)



56
57
58
59
60
61
62
# File 'src/view/suggest_address.rb', line 56

def additional_lines(model)
  area = HtmlGrid::Textarea.new(:additional_lines, 
    model, @session, self)
  area.label = true
  area.css_class = 'standard'
  area
end

- (Object) address_message(model)



63
64
65
66
67
68
69
70
71
72
# File 'src/view/suggest_address.rb', line 63

def address_message(model)
  input = HtmlGrid::Textarea.new(:message, 
    model, @session, self)
  input.set_attribute('wrap', true)
  js = "if(this.value.length > 500) { (this.value = this.value.substr(0,500))}" 
  input.set_attribute('onKeypress', js)
  input.label = true
  input.css_class = 'standard'
  input
end

- (Object) email_suggestion(model)



73
74
75
76
77
78
79
80
81
# File 'src/view/suggest_address.rb', line 73

def (model)
  parent = model.pointer.parent.resolve(@session)
  input = HtmlGrid::InputText.new(:email_suggestion, 
    model, @session, self)
  if(parent.respond_to?(:email))
    input.value = parent.
  end
  input
end

- (Object) init



52
53
54
55
# File 'src/view/suggest_address.rb', line 52

def init
  super
  error_message
end