Changeset 4937 for trunk/gsdl/src


Ignore:
Timestamp:
2003-07-16T10:38:02+12:00 (21 years ago)
Author:
kjdon
Message:

fixed a bug I think I introduced - had put in onChange-updateXX(); into the option macros, but the javascript stuf should only be there for form searching. so added a new arg to the set_option_macro method

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/queryaction.cpp

    r4825 r4937  
    633633
    634634// sets the selection box macros _hselection_, _jselection_, _nselection_ _gselection_, fqfselection_
    635 void queryaction::set_option_macro (const text_t &macroname, text_t current_value, bool display_single,
     635void queryaction::set_option_macro (const text_t &macroname, text_t current_value, bool display_single, bool add_js_update,
    636636                    const FilterOption_t &option, displayclass &disp) {
    637637 
     
    645645  if (option.validValues.size() < 2) return;
    646646 
    647   text_t macrovalue = "<select name=\"" + macroname + "\" onChange=\"update"+macroname+"();\">\n";
     647  text_t macrovalue = "<select name=\"" + macroname + "\"";
     648  if (add_js_update) {
     649    macrovalue += " onChange=\"update"+macroname+"();\"";
     650  }
     651  macrovalue += ">\n";
    648652 
    649653  if (current_value.empty()) current_value = option.defaultValue;
     
    695699    // _hselection_ and _h2selection_ (Index)
    696700    it = response.filterOptions.find ("Index");
    697     if (it != end) set_option_macro ("h", args["h"], true, (*it).second, disp);
    698     if (it != end) set_option_macro ("h2", args["h2"], true,(*it).second, disp);
     701    if (it != end) set_option_macro ("h", args["h"], true, false, (*it).second, disp);
     702    if (it != end) set_option_macro ("h2", args["h2"], true,false, (*it).second, disp);
    699703   
    700704    // _jselection_ and _j2selection_ (Subcollection)
    701705    it = response.filterOptions.find ("Subcollection");
    702     if (it != end) set_option_macro ("j", args["j"], true,(*it).second, disp);
    703     if (it != end) set_option_macro ("j2", args["j2"], true,(*it).second, disp);
     706    if (it != end) set_option_macro ("j", args["j"], true,false, (*it).second, disp);
     707    if (it != end) set_option_macro ("j2", args["j2"], true,false, (*it).second, disp);
    704708   
    705709    // _nselection_ and _n2selection_ (Language)
    706710    it = response.filterOptions.find ("Language");
    707     if (it != end) set_option_macro ("n", args["n"], true,(*it).second, disp);
    708     if (it != end) set_option_macro ("n2", args["n2"], true,(*it).second, disp);
     711    if (it != end) set_option_macro ("n", args["n"], true,false, (*it).second, disp);
     712    if (it != end) set_option_macro ("n2", args["n2"], true,false, (*it).second, disp);
    709713
    710714    // _cq2selection_ (CombineQuery)
    711715    it = response.filterOptions.find ("CombineQuery");
    712     if (it != end) set_option_macro ("cq2", args["cq2"], true,(*it).second, disp);
     716    if (it != end) set_option_macro ("cq2", args["cq2"], true,false, (*it).second, disp);
    713717
    714718    if (args["ct"] == "1") { // mgpp collections
     
    716720      it = response.filterOptions.find("Level");
    717721      if (it!=end) {
    718     set_option_macro("g", args["g"], false, (*it).second, disp);
     722    set_option_macro("g", args["g"], false, false, (*it).second, disp);
    719723    if (args["qt"]=="1") { // form search
    720724      set_gformselection_macro(args["g"], (*it).second, disp);
     
    723727      // _fqfselection_ field list
    724728      it = response.filterOptions.find("IndexField");
    725       if (it!=end) set_option_macro ("fqf", args["fqf"], true, (*it).second, disp);
     729      if (it!=end) {
     730    if (args["qt"]=="1") { // form search
     731      set_option_macro ("fqf", args["fqf"], true, true, (*it).second, disp);
     732    } else {
     733      set_option_macro ("fqf", args["fqf"], true, false, (*it).second, disp);
     734    }
     735      }
    726736    }
    727737  }
  • trunk/gsdl/src/recpt/queryaction.h

    r4780 r4937  
    8585
    8686  virtual void set_option_macro (const text_t &macroname, text_t current_value,
    87                  bool display_single,
     87                 bool display_single, bool add_js_update,
    8888             const FilterOption_t &option, displayclass &disp);
    8989
Note: See TracChangeset for help on using the changeset viewer.