view · edit · sidebar · attach · print · history

20120326-update-searchbar

<< | Index | >>


summary

  • Added compare_search to Home with switch link.

commit

index


Add instant compare_search to Home

To instert inital methods by javascript, overwrite to_html() in Form(CenterdCompareSearchForm) class.

in src/view/drugs/centeredsearchform.rb

...
  def javascripts(context)
    scripts = ''
    @additional_javascripts.each do |script|
      args = {
        'type'     => 'text/javascript',
        'language' => 'JavaScript',
      }
      scripts << context.script(args) do script end
    end
    scripts
  end
  def to_html(context)
    javascripts(context).to_s << super
  end
...

see

  • AutocompleteSearchBar (src/view/searchbar.rb)
    • This class create initialize method for dojo.
NOTE

These are stardard way to create link/button with HtmlGrid

Link
    link = HtmlGrid::Link.new(:search, model, session, self)
    args = { :param => "test" }
    link.href  = @lookandfeel._event_url(:home, args)
    link.value = "test"
    link
Button
    button = HtmlGrid::Button.new(:search, model, @session, self)
    args = { :param => "normal" }
    url  = @lookandfeel._event_url(:home, args)
    button.set_attribute("onclick", "document.location.href='#{url}'")
    button.set_attribute("value", "test")
    button

Persistent user input

SBSM call via initialize > logout> __checkout
Request to TOP page call once logout method. (non-persistent-values are cleared)

SBSM hold only flavor and language value in default.

added :search_form input also to persistent_user_input[:search_form]

Event controll by lookandfeel

to controll event(allow, disallow) by lookandfeel,
use ENABLED and DISABLED

/path/to/sbsm/lookandfeel.rb

  def enabled?(event, default=true)
    default || self::class::ENABLED.include?(event)
  end

refs

Update compare search result

Added FI/PI links in compare search result list.
tested view on each lookandfeels.

see compare_result_list in lookandfeelwrapper.

commit
view · edit · sidebar · attach · print · history
Page last modified on March 28, 2012, at 05:25 PM