[pmapper-users] search.xml with 2 fields (one depending on another)
Dear all,I've been struggling with the search.xml and the dependfld parameter.I want to set a search with 2 fields, one depending on another (a suggest depending on an option) with shapefile data.My problem is that the suggest field suggests all values from the data without taking into account the value chosen in the options field.I've come across this thread http://pmapper-users-p-mapper-users-mailing-list.993774.n3.nabble.com/pmapper-users-search-xml-with-2-fields-td4025124.html and tried all the suggestions from there (namely replace the compressed js files from the ones from trunk) but it still won't work.Here's what my search.xml looks like:$ onchange=$('#pmsfld_DESIGNA').val('').flushCache() Even when I change the connection to db and point to the .dbf file of the shapefile, the suggest list from the second field (DESIGNA) will show all values and not just the values that depend on the first field (TIPE).As the first field (TIPE) has special characters, I thought this might be an issue and eliminated them but even though, the search won't work properly.I'm working with ms4w version 3.0.6 (Apache 2.2.22, PHP 5.4.3, Mapserver version: 6.0.3) in a Windows SP environment (SP3).Thanks.Regards,Sylvain. -- View this message in context: http://pmapper-users-p-mapper-users-mailing-list.993774.n3.nabble.com/search-xml-with-2-fields-one-depending-on-another-tp4025207.html Sent from the pmapper-users -- p.mapper users mailing list mailing list archive at Nabble.com. -- Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with 2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users
Re: [pmapper-users] search.xml with 2 fields
Hi Armin, Thomas, I had to deal with another little problem, accents in the street names from the postgis DB which is encoded in ISO-8859-1. - They are replaced by a special text character in the drop down menu. Just need to specify the right dns for both fields in the search.xml file: dsn encoding=ISO-8859-1 The content of the drop down menu is now ok, but as the main html page is UTF-8 encoded, the query is still sended back to postgis in UTF-8. - Had to add an utf8_decode in suggest.php, function dbSuggestMatch: foreach ($dependFields as $fieldName = $fieldValue) { *pm_logDebug(3, $fieldValue, fieldvalue before utf8decode);** $fieldValue = utf8_decode($fieldValue); //utf8 - iso-8859-1 **pm_logDebug(3, $fieldValue, fieldvalue after utf8decode);* $sql = str_replace(array('[dependfldval]', [dependfldval_$fieldName]), trim($fieldValue), $sql); } the logDebug shows, when searching the street name Genève: [05-Apr-2013 11:18:14] P.MAPPER debug info fieldvalue before utf8decode Genève [05-Apr-2013 11:18:14] P.MAPPER debug info fieldvalue after utf8decode Genève Works fine now, don't know if it is the proper way to do it though for an SVN commit. Talking about SVN, is it ok for you if I let you know through emails what I had to correct to have p.mapper working? Cheers, Chris On Thu, Apr 4, 2013 at 9:32 AM, Chris forum bak.fo...@gmail.com wrote: Hi Armin, Thomas I've just replaced the 3 compressed JS files, search works fine now using them! Ok, flushCache is set. Thx a lot guys, pmapper rocks! Chris On Wed, Apr 3, 2013 at 7:39 PM, Armin Burger armin.bur...@gmail.comwrote: On 04/03/2013 03:55 PM, Chris forum wrote: Should I dare asking a last question? Do I better use this, what is it actually doing? eventsonchange=$('#pmsfld_numero').val('').flushCache()/events that resets the text input field and empties the auto-complete cache of the suggest, so usually it is recommended to be set. You need to adapt the xyz part of '#pmsfld_xyz' to the suggest field name. -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users
Re: [pmapper-users] search.xml with 2 fields
Hi Armin, Thomas I've just replaced the 3 compressed JS files, search works fine now using them! Ok, flushCache is set. Thx a lot guys, pmapper rocks! Chris On Wed, Apr 3, 2013 at 7:39 PM, Armin Burger armin.bur...@gmail.com wrote: On 04/03/2013 03:55 PM, Chris forum wrote: Should I dare asking a last question? Do I better use this, what is it actually doing? eventsonchange=$('#pmsfld_numero').val('').flushCache()/events that resets the text input field and empties the auto-complete cache of the suggest, so usually it is recommended to be set. You need to adapt the xyz part of '#pmsfld_xyz' to the suggest field name. -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users
Re: [pmapper-users] search.xml with 2 fields
Hi Thomas, Thx a lot for the explanation, I have chosen to use the nosubmit=1 parameter. First field works now, the query is not launched anymore when a suggested street name is clicked: definition type=suggest connectiontype=db minlength=1 startleft=1 sort=asc *nosubmit=1* So I am a step further, there is still a problem though with the second field: it doesn't suggest anything: definition type=suggest connectiontype=db sort=asc minlength=1 dependfld=lastname Did you manage to test my data? Does it work on your system? Here, if I choose the street name Abeilles and then type 2 in the second field, nothing is proposed while the numbers 23 , 25, 27 and 29 are in the db (the one I sent you). Sorry to insist... Chris On Tue, Apr 2, 2013 at 6:05 PM, Thomas RAFFIN traf...@sirap.fr wrote: OK, it is due to bad configuration. You could do one of those: - Unactivate auto submit for suggested fields == set PM.suggestLaunchSearch = false; in js_config.php (applies to all suggested fields!) - keep PM.suggestLaunchSearch = true; and add to each definition where it is needed the nosubmit parameter to 1 like this for instance: definition type=suggest connectiontype=db minlength=1 startleft=1 sort=asc nosubmit=1 Bye Thomas Le 02/04/2013 15:43, Chris forum a écrit : Hi Thomas, Please find attached the necessary files to reproduce my environment. Thanx a lot! Chris -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users
Re: [pmapper-users] search.xml with 2 fields
Hi, With your data and this search definition it worked yesterday: searchitem name=goeland_adresses description=Adresses -Suggest Suggest PGSQL- layer type=postgis name=goeland_addresse_lausanne field type=s name=lastname description=Rue wildcard=2 definition type=suggest connectiontype=db minlength=1 startleft=1 sort=asc nosubmit=1 dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT lastname FROM test.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname/sql !--eventsonchange=$('#pmsfld_numero').val('').flushCache()/events-- /definition /field field type=n name=numero description=No wildcard=2 definition type=suggest connectiontype=db sort=asc minlength=0 dependfld=lastname dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT numero FROM test.goeland_addresse_lausanne WHERE numero::text ~* '^[search]' and lastname = '[dependfldval]' ORDER BY numero/sql /definition /field /layer /searchitem Take a look on the dsn that don't need to be re-specified. But it requires 1 character or more. The table is in the test schema here. Le 03/04/2013 10:06, Chris forum a écrit : Hi Thomas, Thx a lot for the explanation, I have chosen to use the nosubmit=1 parameter. First field works now, the query is not launched anymore when a suggested street name is clicked: definition type=suggest connectiontype=db minlength=1 startleft=1 sort=asc *nosubmit=1* So I am a step further, there is still a problem though with the second field: it doesn't suggest anything: definition type=suggest connectiontype=db sort=asc minlength=1 dependfld=lastname Did you manage to test my data? Does it work on your system? Here, if I choose the street name Abeilles and then type 2 in the second field, nothing is proposed while the numbers 23 , 25, 27 and 29 are in the db (the one I sent you). Sorry to insist... Chris On Tue, Apr 2, 2013 at 6:05 PM, Thomas RAFFIN traf...@sirap.fr mailto:traf...@sirap.fr wrote: OK, it is due to bad configuration. You could do one of those: - Unactivate auto submit for suggested fields == set PM.suggestLaunchSearch = false; in js_config.php (applies to all suggested fields!) - keep PM.suggestLaunchSearch = true; and add to each definition where it is needed the nosubmit parameter to 1 like this for instance: definition type=suggest connectiontype=db minlength=1 startleft=1 sort=asc nosubmit=1 Bye Thomas Le 02/04/2013 15:43, Chris forum a écrit : Hi Thomas, Please find attached the necessary files to reproduce my environment. Thanx a lot! Chris -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users
Re: [pmapper-users] search.xml with 2 fields
Still no luck here... I copy/paste your search above, replacing the test shema with public one, but the second field is still not proposing anything. Here under the content of the pm_debug.log, with 'abe'-Abeilles and '2' values used in the fields. Looking at the last line of the log, I have tried to replace '[dependfldval]' with 'Abeilles' in search.xml, and the second field this time proposed me values to choose from! Shouldn't the last line of the log contain 'Abeilles' instead of '[dependfldval]'? It looks like the substitution is not done. [03-Apr-2013 13:44:46] P.MAPPER debug info Validation of search.xml file succeeded [03-Apr-2013 13:44:49] P.MAPPER debug info XML-//definition SimpleXMLElement Object ( [@attributes] = Array ( [type] = suggest [connectiontype] = db [minlength] = 1 [startleft] = 1 [sort] = asc [nosubmit] = 1 ) [dsn] = @ [sql] = SELECT DISTINCT lastname FROM public.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname [comment] = SimpleXMLElement Object ( ) ) [03-Apr-2013 13:44:49] P.MAPPER debug info XML-//definition SimpleXMLElement Object ( [@attributes] = Array ( [type] = suggest [connectiontype] = db [sort] = asc [minlength] = 0 [dependfld] = lastname ) [dsn] = @ [sql] = SELECT DISTINCT numero FROM public.goeland_addresse_lausanne WHERE numero::text ~* '^[search]' and lastname = '[dependfldval]' ORDER BY numero ) [03-Apr-2013 13:44:51] P.MAPPER debug info request Array ( [searchitem] = goeland_adresses [fldname] = lastname [q] = abe [limit] = 0 [timestamp] = 1364989492518 ) [03-Apr-2013 13:44:51] P.MAPPER debug info Parameters for attribute search file: suggest.php function: __construct Array ( [type] = db [sort] = asc [minlength] = 1 [regexleft] = [startleft] = 1 [dsn] = pgsql://user:pass@localhost:5432/goeland [encoding] = UTF-8 [sql] = SELECT DISTINCT lastname FROM public.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname [dependFields] = Array ( ) ) [03-Apr-2013 13:44:51] P.MAPPER debug info SELECT DISTINCT lastname FROM public.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname [03-Apr-2013 13:45:39] P.MAPPER debug info request Array ( [searchitem] = goeland_adresses [fldname] = numero [q] = 2 [limit] = 0 [timestamp] = 1364989540505 [dependfldval] = Abeilles ) [03-Apr-2013 13:45:39] P.MAPPER debug info Parameters for attribute search file: suggest.php function: __construct Array ( [type] = db [sort] = asc [minlength] = 0 [regexleft] = [startleft] = 0 [dsn] = pgsql://user:pass@localhost:5432/goeland [encoding] = UTF-8 [sql] = SELECT DISTINCT numero FROM public.goeland_addresse_lausanne WHERE numero::text ~* '^[search]' and lastname = '[dependfldval]' ORDER BY numero [dependFields] = Array ( ) ) [03-Apr-2013 13:45:39] P.MAPPER debug info SELECT DISTINCT numero FROM public.goeland_addresse_lausanne WHERE numero::text ~* '^2' and lastname = '[dependfldval]' ORDER BY numero On Wed, Apr 3, 2013 at 11:05 AM, Thomas RAFFIN traf...@sirap.fr wrote: Hi, With your data and this search definition it worked yesterday: searchitem name=goeland_adresses description=Adresses -Suggest Suggest PGSQL- layer type=postgis name=goeland_addresse_lausanne field type=s name=lastname description=Rue wildcard=2 definition type=suggest connectiontype=db minlength=1 startleft=1 sort=asc nosubmit=1 dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT lastname FROM test.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname/sql !--eventsonchange=$('#pmsfld_numero').val('').flushCache()/events-- /definition /field field type=n name=numero description=No wildcard=2 definition type=suggest connectiontype=db sort=asc minlength=0 dependfld=lastname dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT numero FROM test.goeland_addresse_lausanne WHERE numero::text ~* '^[search]' and lastname = '[dependfldval]' ORDER BY numero/sql /definition /field /layer /searchitem Take a look on the dsn that don't need to be re-specified. But it requires 1 character or more. The table is in the test schema here. Le 03/04/2013 10:06, Chris forum a écrit : Hi Thomas, Thx a lot for the explanation, I have chosen to use the nosubmit=1 parameter. First field works now, the query is not launched anymore when a suggested street name is clicked: definition type=suggest connectiontype=db minlength=1 startleft=1 sort=asc *nosubmit=1* So I am a step further, there is still a problem though with the second field: it doesn't suggest
Re: [pmapper-users] search.xml with 2 fields
The compress js version is certainly not up-to-date. Try to change your configuration like this: pm_javascript_locationjavascript/src/pm_javascript_location Armin, could you update the js compress files please? Le 03/04/2013 14:35, Chris forum a écrit : Still no luck here... I copy/paste your search above, replacing the test shema with public one, but the second field is still not proposing anything. Here under the content of the pm_debug.log, with 'abe'-Abeilles and '2' values used in the fields. Looking at the last line of the log, I have tried to replace '[dependfldval]' with 'Abeilles' in search.xml, and the second field this time proposed me values to choose from! Shouldn't the last line of the log contain 'Abeilles' instead of '[dependfldval]'? It looks like the substitution is not done. [03-Apr-2013 13:44:46] P.MAPPER debug info Validation of search.xml file succeeded [03-Apr-2013 13:44:49] P.MAPPER debug info XML-//definition SimpleXMLElement Object ( [@attributes] = Array ( [type] = suggest [connectiontype] = db [minlength] = 1 [startleft] = 1 [sort] = asc [nosubmit] = 1 ) [dsn] = @ [sql] = SELECT DISTINCT lastname FROM public.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname [comment] = SimpleXMLElement Object ( ) ) [03-Apr-2013 13:44:49] P.MAPPER debug info XML-//definition SimpleXMLElement Object ( [@attributes] = Array ( [type] = suggest [connectiontype] = db [sort] = asc [minlength] = 0 [dependfld] = lastname ) [dsn] = @ [sql] = SELECT DISTINCT numero FROM public.goeland_addresse_lausanne WHERE numero::text ~* '^[search]' and lastname = '[dependfldval]' ORDER BY numero ) [03-Apr-2013 13:44:51] P.MAPPER debug info request Array ( [searchitem] = goeland_adresses [fldname] = lastname [q] = abe [limit] = 0 [timestamp] = 1364989492518 ) [03-Apr-2013 13:44:51] P.MAPPER debug info Parameters for attribute search file: suggest.php function: __construct Array ( [type] = db [sort] = asc [minlength] = 1 [regexleft] = [startleft] = 1 [dsn] = pgsql://user:pass@localhost:5432/goeland [encoding] = UTF-8 [sql] = SELECT DISTINCT lastname FROM public.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname [dependFields] = Array ( ) ) [03-Apr-2013 13:44:51] P.MAPPER debug info SELECT DISTINCT lastname FROM public.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname [03-Apr-2013 13:45:39] P.MAPPER debug info request Array ( [searchitem] = goeland_adresses [fldname] = numero [q] = 2 [limit] = 0 [timestamp] = 1364989540505 [dependfldval] = Abeilles ) [03-Apr-2013 13:45:39] P.MAPPER debug info Parameters for attribute search file: suggest.php function: __construct Array ( [type] = db [sort] = asc [minlength] = 0 [regexleft] = [startleft] = 0 [dsn] = pgsql://user:pass@localhost:5432/goeland [encoding] = UTF-8 [sql] = SELECT DISTINCT numero FROM public.goeland_addresse_lausanne WHERE numero::text ~* '^[search]' and lastname = '[dependfldval]' ORDER BY numero [dependFields] = Array ( ) ) [03-Apr-2013 13:45:39] P.MAPPER debug info SELECT DISTINCT numero FROM public.goeland_addresse_lausanne WHERE numero::text ~* '^2' and lastname = '[dependfldval]' ORDER BY numero On Wed, Apr 3, 2013 at 11:05 AM, Thomas RAFFIN traf...@sirap.fr mailto:traf...@sirap.fr wrote: Hi, With your data and this search definition it worked yesterday: searchitem name=goeland_adresses description=Adresses -Suggest Suggest PGSQL- layer type=postgis name=goeland_addresse_lausanne field type=s name=lastname description=Rue wildcard=2 definition type=suggest connectiontype=db minlength=1 startleft=1 sort=asc nosubmit=1 dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT lastname FROM test.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname/sql !--eventsonchange=$('#pmsfld_numero').val('').flushCache()/events-- /definition /field field type=n name=numero description=No wildcard=2 definition type=suggest connectiontype=db sort=asc minlength=0 dependfld=lastname dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT numero FROM test.goeland_addresse_lausanne WHERE numero::text ~* '^[search]' and lastname = '[dependfldval]' ORDER BY numero/sql /definition /field /layer /searchitem Take a look on the dsn that don't need to be
Re: [pmapper-users] search.xml with 2 fields
Well done! \o/ Works perfectly now : )) Thank you so much Thomas! Should I dare asking a last question? Do I better use this, what is it actually doing? eventsonchange=$('#pmsfld_numero').val('').flushCache()/events On Wed, Apr 3, 2013 at 3:28 PM, Thomas RAFFIN traf...@sirap.fr wrote: The compress js version is certainly not up-to-date. Try to change your configuration like this: pm_javascript_locationjavascript/src/pm_javascript_location Armin, could you update the js compress files please? Le 03/04/2013 14:35, Chris forum a écrit : Still no luck here... I copy/paste your search above, replacing the test shema with public one, but the second field is still not proposing anything. Here under the content of the pm_debug.log, with 'abe'-Abeilles and '2' values used in the fields. Looking at the last line of the log, I have tried to replace '[dependfldval]' with 'Abeilles' in search.xml, and the second field this time proposed me values to choose from! Shouldn't the last line of the log contain 'Abeilles' instead of '[dependfldval]'? It looks like the substitution is not done. [03-Apr-2013 13:44:46] P.MAPPER debug info Validation of search.xml file succeeded [03-Apr-2013 13:44:49] P.MAPPER debug info XML-//definition SimpleXMLElement Object ( [@attributes] = Array ( [type] = suggest [connectiontype] = db [minlength] = 1 [startleft] = 1 [sort] = asc [nosubmit] = 1 ) [dsn] = @ [sql] = SELECT DISTINCT lastname FROM public.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname [comment] = SimpleXMLElement Object ( ) ) [03-Apr-2013 13:44:49] P.MAPPER debug info XML-//definition SimpleXMLElement Object ( [@attributes] = Array ( [type] = suggest [connectiontype] = db [sort] = asc [minlength] = 0 [dependfld] = lastname ) [dsn] = @ [sql] = SELECT DISTINCT numero FROM public.goeland_addresse_lausanne WHERE numero::text ~* '^[search]' and lastname = '[dependfldval]' ORDER BY numero ) [03-Apr-2013 13:44:51] P.MAPPER debug info request Array ( [searchitem] = goeland_adresses [fldname] = lastname [q] = abe [limit] = 0 [timestamp] = 1364989492518 ) [03-Apr-2013 13:44:51] P.MAPPER debug info Parameters for attribute search file: suggest.php function: __construct Array ( [type] = db [sort] = asc [minlength] = 1 [regexleft] = [startleft] = 1 [dsn] = pgsql://user:pass@localhost:5432/goeland [encoding] = UTF-8 [sql] = SELECT DISTINCT lastname FROM public.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname [dependFields] = Array ( ) ) [03-Apr-2013 13:44:51] P.MAPPER debug info SELECT DISTINCT lastname FROM public.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname [03-Apr-2013 13:45:39] P.MAPPER debug info request Array ( [searchitem] = goeland_adresses [fldname] = numero [q] = 2 [limit] = 0 [timestamp] = 1364989540505 [dependfldval] = Abeilles ) [03-Apr-2013 13:45:39] P.MAPPER debug info Parameters for attribute search file: suggest.php function: __construct Array ( [type] = db [sort] = asc [minlength] = 0 [regexleft] = [startleft] = 0 [dsn] = pgsql://user:pass@localhost:5432/goeland [encoding] = UTF-8 [sql] = SELECT DISTINCT numero FROM public.goeland_addresse_lausanne WHERE numero::text ~* '^[search]' and lastname = '[dependfldval]' ORDER BY numero [dependFields] = Array ( ) ) [03-Apr-2013 13:45:39] P.MAPPER debug info SELECT DISTINCT numero FROM public.goeland_addresse_lausanne WHERE numero::text ~* '^2' and lastname = '[dependfldval]' ORDER BY numero On Wed, Apr 3, 2013 at 11:05 AM, Thomas RAFFIN traf...@sirap.fr wrote: Hi, With your data and this search definition it worked yesterday: searchitem name=goeland_adresses description=Adresses -Suggest Suggest PGSQL- layer type=postgis name=goeland_addresse_lausanne field type=s name=lastname description=Rue wildcard=2 definition type=suggest connectiontype=db minlength=1 startleft=1 sort=asc nosubmit=1 dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT lastname FROM test.goeland_addresse_lausanne WHERE lastname IS NOT NULL ORDER BY lastname/sql !--eventsonchange=$('#pmsfld_numero').val('').flushCache()/events-- /definition /field field type=n name=numero description=No wildcard=2 definition type=suggest connectiontype=db sort=asc minlength=0 dependfld=lastname dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT numero FROM test.goeland_addresse_lausanne WHERE numero::text ~*
Re: [pmapper-users] search.xml with 2 fields
On 04/03/2013 03:28 PM, Thomas RAFFIN wrote: The compress js version is certainly not up-to-date. Armin, could you update the js compress files please? Hi Thomas I updated now the compressed JS files to SVN trunk. I was believing you were also committing these ones to SVN. It means that the pmapper 4.3 release will very likely have outdated files as well since I just exported it from SVN trunk... Armin -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users
Re: [pmapper-users] search.xml with 2 fields
On 04/03/2013 03:55 PM, Chris forum wrote: Should I dare asking a last question? Do I better use this, what is it actually doing? eventsonchange=$('#pmsfld_numero').val('').flushCache()/events that resets the text input field and empties the auto-complete cache of the suggest, so usually it is recommended to be set. You need to adapt the xyz part of '#pmsfld_xyz' to the suggest field name. -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users
Re: [pmapper-users] search.xml with 2 fields
Still struggling with the search function. To resume what I am experiencing with a 2 fields search, which consists in finding a street name and then a building number on this street: 1) It looks like I can not set the first field search mode to 'options', my postgis table is too big (~10'000 rows). If I do, even though the values are there (Firebug can lists the option values), they are not displayed in the drop down menu. 2) When I set the first field mode to 'suggest', it works but the query is launched as soon as I click on a proposed value. So when I click on a street name, the query is done before I can specify a building number. Is a two fields search supposed to work with both fields using 'suggest' mode? If so, do you have any idea why the search doesn't wait for the second input before launching the query? Any working exemple available? Link to the gisdb postgis table used in the dev search.xml? Thanx, Chris On Wed, Mar 27, 2013 at 3:56 PM, Chris forum bak.fo...@gmail.com wrote: Hi Thomas, Thx for your fast reply! The searchitem of my last message was related to a shapefile for a test. That's why I didn't add an SQL query in it as I didn't see any shapefile example with an sql tag. Anyway, I just tried to add: sqlSELECT DISTINCT NUMBER FROM building _shp WHERE TYPE = '[dependfldval]' AND NUMBER ~* '[search]' ORDER BY NUMBER /sql But the second field is still not filtered... : ( From what I see, you example with 2 fields is dealing with a PGSQL table. Here is what I have: searchitem name=addresses description=Addresses -Suggest Suggest PGSQL- layer type=postgis name=Address_table field type=s name=Address_field description=Street wildcard=2 definition type=suggest connectiontype=db minlength=1 startleft=1 sort=asc dsn encoding=UTF-8pgsql://user:pass@localhost /db/dsn sqlSELECT DISTINCT Address_field FROM public.Address_table WHERE Address_field IS NOT NULL ORDER BY Address_field/sql eventsonchange=$('#pmsfld_number_field').val('').flushCache()/events /definition /field field type=n name=Number_field description=Nb wildcard=2 definition type=suggest connectiontype=db sort=asc minlength=3 dependfld=Address_field dsn encoding=UTF-8pgsql://user:pass@localhost /db/dsn sqlSELECT DISTINCT Number_field FROM public.goeland_addresse_lausanne WHERE Number_field ~* '^[search]' {and Address_field = '[dependfldval]'} ORDER BY Number_field/sql /definition /field /layer /searchitem First field works, but the query is made as soon as I choose one entry in the list. No chance to select anything on the 2nd field. If I switch the first field mode to 'options', the drop down menu comes empty. Actually the values are in there, but just not displayed... very strange. In case the problem is there, here under the related layer of my mapfile: LAYER NAME Address_table TYPE POINT DATA geom from Address_table using unique idaddress using srid=21781 CONNECTIONTYPE postgis CONNECTION user=user password=pass dbname=db host=localhost port=5432 METADATA DESCRIPTION Addresses RESULT_FIELDS idaddress, Address_table, Number_field RESULT_HEADERS ID, Street, Nb ows_title addresses END TEMPLATE void CLASS STYLE SYMBOL circle COLOR 255 0 125 MINSIZE 1 SIZE 6 MAXSIZE 10 END END END Do you see anything wrong/missing? On Wed, Mar 27, 2013 at 2:55 PM, Thomas RAFFIN traf...@sirap.fr wrote: I think you have to define the SQL query for suggest option with depend field val. Here is an example for the 2d field that depend on field1 field type=s name=field2 description=Field 2 wildcard=0 size=15 definition type=suggest connectiontype=db startleft=1 sort=asc minlength=4 dependfld=field1 dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT field2 FROM schema.table WHERE field1 = '[dependfldval]' AND field2 ~* '[search]' ORDER BY field2/sql events/events /definition /field NB: it is possible to use many depend fields, but if it doesn't works already, maybe I've forgotten to commit something... field type=s name=field1 description=Field 1 wildcard=0 size=15 eventsonchange=$('#pmsfld_field2').val('');$('#pmsfld_field2').flushCache();/events /field field type=s name=field2 description=Field 2 wildcard=0 size=15 definition type=suggest connectiontype=db startleft=1 sort=asc minlength=4 dependfld=field1 dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT field2 FROM schema.table WHERE field1 = '[dependfldval]' AND field2
Re: [pmapper-users] search.xml with 2 fields
Hi, Le 02/04/2013 10:08, Chris forum a écrit : Still struggling with the search function. To resume what I am experiencing with a 2 fields search, which consists in finding a street name and then a building number on this street: 1) It looks like I can not set the first field search mode to 'options', my postgis table is too big (~10'000 rows). If I do, even though the values are there (Firebug can lists the option values), they are not displayed in the drop down menu. 2) When I set the first field mode to 'suggest', it works but the query is launched as soon as I click on a proposed value. So when I click on a street name, the query is done before I can specify a building number. I don't remember how to do this, but i'm sure a suggest field is able to not send search Is a two fields search supposed to work with both fields using 'suggest' mode? If so, do you have any idea why the search doesn't wait for the second input before launching the query? I will check code, but it shoudl work as you discribed. Any working exemple available? Link to the gisdb postgis table used in the dev search.xml? Could you send me small SQL scripts to create and populate DB (and the corresponding mapfile layer part) please? Thanx, Chris On Wed, Mar 27, 2013 at 3:56 PM, Chris forum bak.fo...@gmail.com mailto:bak.fo...@gmail.com wrote: Hi Thomas, Thx for your fast reply! The searchitem of my last message was related to a shapefile for a test. That's why I didn't add an SQL query in it as I didn't see any shapefile example with an sql tag. Anyway, I just tried to add: sqlSELECT DISTINCT NUMBER FROM building _shp WHERE TYPE = '[dependfldval]' AND NUMBER ~* '[search]' ORDER BY NUMBER /sql But the second field is still not filtered... : ( From what I see, you example with 2 fields is dealing with a PGSQL table. Here is what I have: searchitem name=addresses description=Addresses -Suggest Suggest PGSQL- layer type=postgis name=Address_table field type=s name=Address_field description=Street wildcard=2 definition type=suggest connectiontype=db minlength=1 startleft=1 sort=asc dsn encoding=UTF-8pgsql://user:pass@localhost/db/dsn sqlSELECT DISTINCT Address_field FROM public.Address_table WHERE Address_field IS NOT NULL ORDER BY Address_field/sql eventsonchange=$('#pmsfld_number_field').val('').flushCache()/events /definition /field field type=n name=Number_field description=Nb wildcard=2 definition type=suggest connectiontype=db sort=asc minlength=3 dependfld=Address_field dsn encoding=UTF-8pgsql://user:pass@localhost/db/dsn sqlSELECT DISTINCT Number_field FROM public.goeland_addresse_lausanne WHERE Number_field ~* '^[search]' {and Address_field = '[dependfldval]'} ORDER BY Number_field/sql /definition /field /layer /searchitem First field works, but the query is made as soon as I choose one entry in the list. No chance to select anything on the 2nd field. If I switch the first field mode to 'options', the drop down menu comes empty. Actually the values are in there, but just not displayed... very strange. In case the problem is there, here under the related layer of my mapfile: LAYER NAME Address_table TYPE POINT DATA geom from Address_table using unique idaddress using srid=21781 CONNECTIONTYPE postgis CONNECTION user=user password=pass dbname=db host=localhost port=5432 METADATA DESCRIPTION Addresses RESULT_FIELDS idaddress, Address_table, Number_field RESULT_HEADERS ID, Street, Nb ows_title addresses END TEMPLATE void CLASS STYLE SYMBOL circle COLOR 255 0 125 MINSIZE 1 SIZE 6 MAXSIZE 10 END END END Do you see anything wrong/missing? On Wed, Mar 27, 2013 at 2:55 PM, Thomas RAFFIN traf...@sirap.fr mailto:traf...@sirap.fr wrote: I think you have to define the SQL query for suggest option with depend field val. Here is an example for the 2d field that depend on field1 field type=s name=field2 description=Field 2 wildcard=0 size=15 definition type=suggest connectiontype=db startleft=1 sort=asc minlength=4 dependfld=field1 dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT field2 FROM schema.table WHERE field1 = '[dependfldval]' AND field2 ~* '[search]' ORDER BY field2/sql events/events
Re: [pmapper-users] search.xml with 2 fields
OK, it is due to bad configuration. You could do one of those: - Unactivate auto submit for suggested fields == set PM.suggestLaunchSearch = false; in js_config.php (applies to all suggested fields!) - keep PM.suggestLaunchSearch = true; and add to each definition where it is needed the nosubmit parameter to 1 like this for instance: definition type=suggest connectiontype=db minlength=1 startleft=1 sort=asc nosubmit=1 Bye Thomas Le 02/04/2013 15:43, Chris forum a écrit : Hi Thomas, Please find attached the necessary files to reproduce my environment. Thanx a lot! Chris -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users
[pmapper-users] search.xml with 2 fields
Hi all, I am having a hard time getting to work a search with 2 fields, second one being dependant of the first one. I especially would like to do that with data coming from PGSQL . I know there are examples in the search.xml of the wiki, but I am not able to reproduce them with the demo data: - Cities Options Suggest MS: P.MAPPER ERROR: This version of PHP does support dBase functions - Communes Suggest PG: I can not find where to download the PGSQL database gisdb Does anyone have a link where to get gisdb database? Here under what I tried with my own shapefile data. This sort of work, but the second field is not filtered according to what has been chosen on the first field. searchitem name=Test description=Test -Options Suggest MS- layer type=shape name=building _shp field type=s name=TYPE description=Building Type wildcard=2 definition type=options connectiontype=ms sort=asc firstoption=* mslayer encoding=ISO-8859-1 keyfield=TYPE showfield=TYPE/ eventsonchange=$('#pmsfld_NUMBER').val('').flushCache()/events /definition /field field type=s name=NUMBER description=Building Number wildcard=2 definition type=suggest connectiontype=ms minlength=1 startleft=1 sort=asc dependfld=TYPE mslayer encoding=ISO-8859-1 keyfield=NUMBER showfield=NUMBER/ /definition /field /layer /searchitem Regards, Chris -- Own the Future-Intelreg; Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users
Re: [pmapper-users] search.xml with 2 fields
I think you have to define the SQL query for suggest option with depend field val. Here is an example for the 2d field that depend on field1 field type=s name=field2 description=Field 2 wildcard=0 size=15 definition type=suggest connectiontype=db startleft=1 sort=asc minlength=4 dependfld=field1 dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT field2 FROM schema.table WHERE field1 = '[dependfldval]' AND field2 ~* '[search]' ORDER BY field2/sql events/events /definition /field NB: it is possible to use many depend fields, but if it doesn't works already, maybe I've forgotten to commit something... field type=s name=field1 description=Field 1 wildcard=0 size=15 eventsonchange=$('#pmsfld_field2').val('');$('#pmsfld_field2').flushCache();/events /field field type=s name=field2 description=Field 2 wildcard=0 size=15 definition type=suggest connectiontype=db startleft=1 sort=asc minlength=4 dependfld=field1 dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT field2 FROM schema.table WHERE field1 = '[dependfldval]' AND field2 ~* '[search]' ORDER BY att1/sql eventsonchange=$('#pmsfld_field3').val('');$('#pmsfld_field3').flushCache();/events /definition /field field type=s name=field3 description=Field 3 wildcard=0 size=15 definition type=suggest connectiontype=db startleft=1 sort=asc minlength=4 dependfld=field1,field2 dsn encoding=UTF-8@/dsn sqlSELECT DISTINCT field3 FROM schema.table WHERE field1 = '[dependfldval_field1 ]' AND field2 = '[dependfldval_field2]' AND field3 ~* '[search]' ORDER BY field3/sql events/events /definition /field Le 27/03/2013 14:15, Chris forum a écrit : Hi all, I am having a hard time getting to work a search with 2 fields, second one being dependant of the first one. I especially would like to do that with data coming from PGSQL . I know there are examples in the search.xml of the wiki, but I am not able to reproduce them with the demo data: - Cities Options Suggest MS: P.MAPPER ERROR: This version of PHP does support dBase functions - Communes Suggest PG: I can not find where to download the PGSQL database gisdb Does anyone have a link where to get gisdb database? Here under what I tried with my own shapefile data. This sort of work, but the second field is not filtered according to what has been chosen on the first field. searchitem name=Test description=Test -Options Suggest MS- layer type=shape name=building _shp field type=s name=TYPE description=Building Type wildcard=2 definition type=options connectiontype=ms sort=asc firstoption=* mslayer encoding=ISO-8859-1 keyfield=TYPE showfield=TYPE/ eventsonchange=$('#pmsfld_NUMBER').val('').flushCache()/events /definition /field field type=s name=NUMBER description=Building Number wildcard=2 definition type=suggest connectiontype=ms minlength=1 startleft=1 sort=asc dependfld=TYPE mslayer encoding=ISO-8859-1 keyfield=NUMBER showfield=NUMBER/ /definition /field /layer /searchitem Regards, Chris -- Own the Future-Intelreg; Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users -- Thomas RAFFIN Chef de Projet Internet traf...@sirap.fr mailto:traf...@sirap.fr Sirap http://sirap.fr Tel : 04 75 72 84 10 Fax : 04 75 70 07 98 Rue Paul Louis Héroult - BP 253 26106 Romans cedex -- Own the Future-Intelreg; Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d ___ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users