[fusion-users] RE: Fusion Search widget - Error when using Filter

miansi AndreiSinelnikov at SierraSystems.com
Wed Nov 10 14:23:54 EST 2010


I do not recall search widget being requirement/in scope for 5.3



Sent from my Windows® phone.

-----Original Message-----
From: kelll [via OSGeo.org] <ml-node+5726085-1574098585-217876 at n2.nabble.com>
Sent: November 10, 2010 2:11 PM
To: Sinelnikov, Andrei <AndreiSinelnikov at SierraSystems.com>
Subject: Fusion Search widget - Error when using Filter

Hi there,

I am trying to implement the fusion search widget. Im using fusion version 2.0.0 with Mapguide OS 2.1.
My mapguide is within an iFrame.

Here is my search widget settings in ApplicationDefinition.xml:

<Widget xsi:type="UiWidgetType">
  <Name>toolbarSearch</Name>
  <Type>Search</Type>
  <StatusText>Search.</StatusText>
  <ImageUrl>images/icons/search.png</ImageUrl>
  <ImageClass/>
  <Tooltip>Search</Tooltip>
  <Extension>
        <Target></Target>
        <Prompt>Hello</Prompt>
        <MatchLimit>50</MatchLimit>
        <ResultColumns>
                <Column><Name>c1</Name><Property>DisplayId</Property></Column>
                <Column><Name>c2</Name><Property>LocationDescription</Property></Column>
        </ResultColumns>
        <Filter>DisplayId = '%$USER_VARIABLE%'</Filter>
  </Extension>
  <Label></Label>
  <Disabled/>
</Widget>


When I activate this widget, it pops open in a window with a search prompt (as expected).

So I'm dealing with a couple of problems here:
1. If I leave the search prompt blank and click search, it always routes to the ErrorPage.templ and then
errors out in javascript with errors like 'mapName' is undefined.
I added the mapName variable at line 31 so that the page could find mapName:
var popup = %s;
var mapName = "%s";

I also edited the OnError event in Search.php to be:
function OnError($title, $msg)
{
    global $target, $popup, $mapName;
    $templ = file_get_contents("./ErrorPage.templ");
    print sprintf($templ, $popup, $mapName, $title, $msg);
}

Doing this stops the error, but then I get more errors.. I try to keep resolving these errors, but they keep coming... so I feel like I'm going down the wrong path here...

2. The following option for my search widget is causing the search to route to the ErrorPage.templ (which brings up all of the problems mentioned above):
<Filter>DisplayId = '%$USER_VARIABLE%'</Filter>

When I remove this option, or to be more specific, when I remove the percentages from it, the search works perfectly. (Of course then I am unable to search for partial words though)

I found another post here:
http://osgeo-org.1803224.n2.nabble.com/Fusion-error-with-query-search-on-ApplicationDefinition-td4802652.html#a4802864<http://osgeo-org.1803224.n2.nabble.com/Fusion-error-with-query-search-on-ApplicationDefinition-td4802652.html?by-user=t#a4802864>

which suggests to do this:

<Filter>DisplayId = '%25$USER_VARIABLE%25'</Filter>

but this is still upsetting the widget.

Can anyone provide a working example of the fusion search widget with accompanying code? or can anyone help me out with either problem?

3. Also, is there a way to have two clauses in the filter? DisplayId LIKE '%blah%' OR LocationDescription LIKE '%blah%'

Thanks in advance,
Kellie



________________________________
View message @ http://osgeo-org.1803224.n2.nabble.com/Fusion-Search-widget-Error-when-using-Filter-tp5726085p5726085.html
To start a new topic under Fusion Users, email ml-node+2061508-553319226-217876 at n2.nabble.com
To unsubscribe from Fusion Users, click here<http://osgeo-org.1803224.n2.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=2061508&code=QW5kcmVpU2luZWxuaWtvdkBTaWVycmFTeXN0ZW1zLmNvbXwyMDYxNTA4fC0xMTM3NjE1Njgw>.


----Notice Regarding Confidentiality----

This email, including any and all attachments, (this “Email”) is intended only for the party to whom it is addressed and may contain information that is confidential or privileged.  Sierra Systems Group Inc. and its affiliates accept no responsibility for any loss or damage suffered by any person resulting from any unauthorized use of or reliance upon this Email.  If you are not the intended recipient, you are hereby notified that any dissemination, copying or other use of this Email is prohibited.  Please notify us of the error in communication by return email and destroy all copies of this Email. Thank you.

-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Fusion-Search-widget-Error-when-using-Filter-tp5726085p5726130.html
Sent from the Fusion Users mailing list archive at Nabble.com.


More information about the fusion-users mailing list