I've created the following sqlview and I'm trying to pass a comma
separated list of "1,2,23,123" to %event_types% from javascript

 

                SELECT `fid`, `title`, `description`, `lonlat`,
`event_type` FROM `events` WHERE `event_type` IN (%event_types%)

 

Here is the javascript I'm using to create my WMS layer:

 

                var events = new OpenLayers.Layer.WMS("Events",

 
"http://geoserver.joetito.com:80/geoserver/wfs";, 

                                {

                                               layers: 'events', 

                                                transparent: true, 

                                                format: 'image/gif',

                                                viewparams:
'event_type:1,2' 

                                }

                );

 

If I pass the string "event_type:1,2" or "event_type:1\,2", GeoServer
complains:

 

                1 layers requested, but found 2 view params specified

 

If I pass the strong "event_type:1\\,2", GeoServer doesn't return any
data. I looked at my GeoServer logs, and it seems that if I pass it this
way, it resolved to:

 

                VIEWPARAMS=event_type:1\,2

 

Has anyone else had problems passing CSV lists to sqlviews? If so, how
do I get around this?

 

Thanks

 

Joe Tito

------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry® mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry® DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to