[fusion-trac] #89: Search panel: incorrect parameters javascript calls

Fusion trac_fusion at osgeo.org
Tue Jul 15 08:17:13 EDT 2008


#89: Search panel: incorrect parameters javascript calls
------------------------+---------------------------------------------------
   Reporter:  pagameba  |       Owner:  madair at dmsolutions.ca
       Type:  defect    |      Status:  new                  
   Priority:  P2        |   Milestone:  1.0.7                
  Component:  Widgets   |     Version:  1.0.6                
   Severity:  Major     |    Keywords:                       
External_id:            |       State:  Approved             
    Browser:  All       |          Os:  All                  
------------------------+---------------------------------------------------
 Reported by Rémy, filed in mapguide trac as:

 http://trac.osgeo.org/mapguide/ticket/630

 This appears to be a copy/paste error when we brought the search panel
 over, to be fixed in 1.0 and trunk.

 --

 I found a fix that worked.

 First, looking at widgets/Search/Search.templ:

 {{{
 function CellClicked(sel)
 {
     var map = GetParent().Fusion.getMapByName(mapName);
     map.setSelection(sel, false, true);
 }
 }}}
 Should be changed like this to match correctly the API:

 {{{
 function CellClicked(sel)
 {
     var map = GetParent().Fusion.getMapByName(mapName);
     map.setSelection(sel, true);
 }
 }}}

 Second, the call to setSelection from map object is (lib/Map.js):

 {{{
 setSelection: function(selText, requery, zoomTo) {
          for (var i=0; i<this.aMaps.length; i++ ) {
              this.aMaps[i].setSelection(selText, requery, zoomTo);
          }
       }
 }}}

 Should be changed like this to match correctly the API:

 {{{
 setSelection: function(selText, zoomTo) {
          for (var i=0; i<this.aMaps.length; i++ ) {
              this.aMaps[i].setSelection(selText, zoomTo);
          }
       },
 }}}

 Finally, setSelection from Mapguide.js has for params:

 {{{
 'selection': encodeURIComponent(selText),
 }}}

 it's proposed to change like this:


 {{{
 'selection': selText,
 }}}

 encodeURIComponent encodes twice the params and that make the call-back
 error happend.

 We see that setSelection has finally in Mapguide.js only 2 parameters:
 selText, zoomTo.
 But in Map.js and Search.templ it was called with 3 parameters: selText,
 requery, zoomTo

 Quite confusing for a mistake.

 Rémy

-- 
Ticket URL: <http://trac.osgeo.org/fusion/ticket/89>
Fusion <http://trac.osgeo.org/fusion>
Fusion is a web-mapping application development framework for MapServer and MapGuide OS.


More information about the fusion-trac mailing list