Ticket #630 (closed defect: fixed)
Fusion search widget bug: solution proposed
| Reported by: | poulet1212 | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Fusion | Version: | 2.0.1 |
| Severity: | critical | Keywords: | |
| Cc: | chrisclaydon | External ID: |
Description
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
