Class: ODDB::View::CenteredSearchForm

Inherits:
HtmlGrid::Form
  • Object
show all
Defined in:
src/view/centeredsearchform.rb

Direct Known Subclasses

Admin::CenteredSearchForm, Drugs::CenteredSearchForm, User::CenteredSearchForm

Constant Summary

COMPONENTS =
{
  [0,0]     =>  View::TabNavigation,
  [0,2,0,1] =>  :search_query,
  [0,3,0,2] =>  :submit,
  [0,3,0,3] =>  :search_reset,
}
COMPONENT_CSS_MAP =
{
  [0,0]   => 'component tabnavigation',
}
CSS_MAP =
{
  [0,2,1,2] =>  'center',
}
CSS_CLASS =

‘center’

nil
EVENT =
:search
FORM_METHOD =
'POST'
SYMBOL_MAP =
{
  :search_query     =>  View::SearchBar, 
}
HTML_ATTRIBUTES =
{
  #'width'        =>  '100%',
  #'text-align' =>  'center',
}

Instance Method Summary (collapse)

Instance Method Details

- (Object) init



84
85
86
87
# File 'src/view/centeredsearchform.rb', line 84

def init
  self.onload = "document.getElementById('searchbar').focus();"
  super
end

- (Object) search_help(model, session)



88
89
90
91
92
93
94
95
# File 'src/view/centeredsearchform.rb', line 88

def search_help(model, session)
  button = HtmlGrid::Button.new(:search_help, model, session, self)
  url = @lookandfeel._event_url(:help)
  props = "scrollbars=yes,resizable=no,toolbar=yes,menubar=no,locationbar=no,width=600,height=500";
  script = "window.open('#{url}', '#{@name}', '#{props}').focus(); return false"
  button.set_attribute('onClick', script)
  button
end

- (Object) search_reset(model, session)



96
97
98
99
100
101
102
103
# File 'src/view/centeredsearchform.rb', line 96

def search_reset(model, session)
  if(@lookandfeel.enabled?(:search_reset))
    button = HtmlGrid::Button.new(:search_reset, model, session, self)
    button.set_attribute("type", "reset")
    #button.set_attribute("align", "center")
    button
  end
end