[mapguide-trac] #630: Fusion search widget bug: solution proposed
MapGuide Open Source
trac_mapguide at osgeo.org
Mon Jul 14 16:47:15 EDT 2008
#630: Fusion search widget bug: solution proposed
--------------------------+-------------------------------------------------
Reporter: poulet1212 | Owner:
Type: defect | Status: new
Priority: high | Milestone:
Component: Fusion | Version: 2.0.1
Severity: critical | Keywords:
External_id: |
--------------------------+-------------------------------------------------
Hi all,
already described the problem here:
http://trac.osgeo.org/mapguide/ticket/623
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/mapguide/ticket/630>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals
More information about the mapguide-trac
mailing list