Just another question also. I still have not got this filtering to work even if I see the cql_filter params in the WMS request. I wonder also since I generate a variable every time a search is done. Will the newest search params be used on the WMS.getFeatureInfo or do I in some way have to push the new variable to the WMS.getFeatureInfo. I guess the javascript is read once when the page is loaded. I.ex. I use  this function<div>
<br></div><div>var filter_param = param;</div><div><span class="Apple-style-span" style="border-collapse:collapse;color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"> info = new OpenLayers.Control.WMSGetFeatureInfo({....</span></div>
<div><span class="Apple-style-span" style="border-collapse:collapse;color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">...</span></div><div><span class="Apple-style-span" style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><div>
vendorParams:{</div><div><span style="white-space:pre-wrap">        </span>                    CQL_FILTER:filter_param</div></span><br><span class="Apple-style-span" style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><div>
                    }, ......</div><div><br></div><div>Will each click use the new updated "param" or just use the one defined upon page load?</div><div><br></div><div>~asle </div></span></div><div><br><div class="gmail_quote">
2012/6/9 Asle Benoni <span dir="ltr"><<a href="mailto:asle.benoni@gmail.com" target="_blank">asle.benoni@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks. I tried this code:<div><div><br></div><div>vendorParams:{</div><div><span style="white-space:pre-wrap">       </span>                    CQL_FILTER:filter_param</div><div>                    },</div><br>
<div class="gmail_quote">But then the popups do not fire and I get this error in Firebug:</div><div class="gmail_quote"><pre><code>Layers and filters are mismatched, you need to provide one filter for each layer</code></pre>

</div><div class="gmail_quote">So I am still doing something wrong?</div><span class="HOEnZb"><font color="#888888"><div class="gmail_quote"><br></div><div class="gmail_quote">~asle</div></font></span><div><div class="h5">
<div class="gmail_quote"><br></div><div class="gmail_quote">2012/6/9 Dominik Mikiewicz <span dir="ltr"><<a href="mailto:dominikmikiewicz@o2.pl" target="_blank">dominikmikiewicz@o2.pl</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="PL" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Geoserver uses cql_filter as far as I remember. Try replacing filter_param with cql_filter and you should be ok<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:openlayers-users-bounces@lists.osgeo.org" target="_blank">openlayers-users-bounces@lists.osgeo.org</a> [mailto:<a href="mailto:openlayers-users-bounces@lists.osgeo.org" target="_blank">openlayers-users-bounces@lists.osgeo.org</a>] <b>On Behalf Of </b>Asle Benoni<br>

<b>Sent:</b> Saturday, June 09, 2012 1:13 PM<br><b>To:</b> Ignacio Talavera<br><b>Cc:</b> <a href="mailto:openlayers-users@lists.osgeo.org" target="_blank">openlayers-users@lists.osgeo.org</a><br><b>Subject:</b> Re: [OpenLayers-Users] How to use CQL filter in OpenLayers.Control.WMSGetFeatureInfo?<u></u><u></u></span></p>

<div><div><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thank you for putting me in this direction.<br>I get an error with your suggested code. <span><u></u><u></u></span></p><div><p class="MsoNormal">
<span>missing ; before statement</span><u></u><u></u></p></div><div><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:0cm 0cm 0cm 0cm"></td><td style="padding:0cm 0cm 0cm 0cm"><pre>var filter_param["cql_filter"] = "norsknavngruppe LIKE '%Sopp%';<u></u><u></u></pre>

<pre><span><span style="font-family:"Arial","sans-serif"">So I tried this:</span></span><u></u><u></u></pre></td></tr></tbody></table></div><div><p class="MsoNormal"><br>          <b>var filter_param = "norsknavngruppe LIKE '%Sopp%'";</b><br>

                   info = new OpenLayers.Control.WMSGetFeatureInfo({<br>                   url: '<a href="http://kart.naturkart.no/geoserver/wms" target="_blank">http://kart.naturkart.no/geoserver/wms</a>',<br>                   title: 'Identify features by clicking',<br>

                   queryVisible: true,<br>                   infoFormat:'application/vnd.ogc.gml',<br>                   <b>vendorParams:{<br>                   filter_param:filter_param<br>                   },</b><br>

                   eventListeners: {<br>                       getfeatureinfo: function(event) {<br>                           if (popup) {<br>                               map.removePopup(popup);<br>                           } .........<u></u><u></u></p>

<div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I get no error and I see (in Firebug) that this is added to the WMS request:<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">

<code><span style="font-size:10.0pt">&info_format=application%2Fvnd.ogc.gml&filter_param=norsknavngruppe%20LIKE%20'%25Sopp%25'</span></code><u></u><u></u></p></div><div><p class="MsoNormal">Still I get no filtering of the popups and it shows any data that is in the clicked location. I see that the response contains i.ex.<u></u><u></u></p>

</div><div><p class="MsoNormal"><gbif_ns:norsknavngruppe>Lav</gbif_ns:norsknavngruppe><u></u><u></u></p></div><div><p class="MsoNormal">and it should not be included since I only want "norsknavngruppe LIKE '%Sopp%". <u></u><u></u></p>

</div><div><p class="MsoNormal">Is there something wrong with my code? Thanks for any suggestions!<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><br><br>2012/6/8 Ignacio Talavera <<a href="mailto:ignacio.talavera@gmail.com" target="_blank">ignacio.talavera@gmail.com</a>>:<br>

> Hi the WMSGetFeatureInfo manage additionals parameters of the url of the<br>> GetFeatureInfo Request in  vendorparams attribute.<br>> So try to add this to your code<br>><br>> var filter_param["cql_filter"] = prosjektnummer LIKE '%2008-25%' OR<br>

> prosjektnavn LIKE '%2008-25%<br>> info = new OpenLayers.Control.WMSGetFeatureInfo({<br>>                    url: '<a href="http://kart.naturkart.no/geoserver/wms" target="_blank">http://kart.naturkart.no/geoserver/wms</a>',<br>

>                    title: 'Identify features by clicking',<br>>                    queryVisible: true,<br>>                    infoFormat:'application/vnd.ogc.gml',<br>>                    vendorParams:filter_param<br>

> eventListeners: {<br>>                        getfeatureinfo: function(event) {<br>>                            if (popup) {<br>>                                map.removePopup(popup);<br>>                            } ........................<br>

> I hope this is useful to you.<br>> Regards<br>> Nacho<br>> On Thu, Jun 7, 2012 at 11:48 AM, Asle Benoni <<a href="mailto:asle.benoni@gmail.com" target="_blank">asle.benoni@gmail.com</a>> wrote:<br>>><br>

>> I have made this map: <a href="http://www.babkart.no" target="_blank">www.babkart.no</a><br>>><br>>> I have a search box that on select of the results sends a refresh of<br>>> the layer with CQL parameters to GeoServer. This works.<br>

>> But of course when I click I get popups of all the markers, even if<br>>> they are hidden because I understand that I send a WMS request without<br>>> any filter.<br>>><br>>> So I need help how to use the generated CQL params in my WMS request<br>

>> for GetFeautureInfo to GeoServer.<br>>><br>>> My function CQLfilter in app.js on line 1027 produces this link:<br>>> prosjektnummer LIKE '%2008-25%' OR prosjektnavn LIKE '%2008-25%<br>

>> which I use to filter the map.<br>>><br>>> The question is how I can use this (or IF I can use it!) in my<br>>> function (line 907):<br>>><br>>> info = new OpenLayers.Control.WMSGetFeatureInfo({<br>

>>                    url: '<a href="http://kart.naturkart.no/geoserver/wms" target="_blank">http://kart.naturkart.no/geoserver/wms</a>',<br>>>                    title: 'Identify features by clicking',<br>

>>                    queryVisible: true,<br>>>                    infoFormat:'application/vnd.ogc.gml',<br>>>                    eventListeners: {<br>>>                        getfeatureinfo: function(event) {<br>

>>                            if (popup) {<br>>>                                map.removePopup(popup);<br>>>                            } ........................<br>>><br>>> Any ideas on how to use the CQL code here?<br>

>><br>>> ~asle<br>>> _______________________________________________<br>>> Users mailing list<br>>> <a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br>>> <a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>

><br>><u></u><u></u></p></div></div></div></div></div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>