Hi Armin, Hi all,
I am still working on a query setup and have some questions.
My goal is to have a search option that lets the users localize them on the
map by selecting an address (street name + building number).
I have a Postgis POINT table (buildingaddress) with the following fields:
| street_id (INT) | street_name (VARCHAR) | building_number (VARCHAR) |
-------------------------------------------------------------------------------------------------------------
| 123456 | Alps, Avenue |
12bis |
and these search parameters:
<searchitem name="street_number_options_suggest_pg" description="Street
Number -Options Suggest PG-">
<layer type="postgis" name="buildingaddress">
<field type="n" name="street_id" description="Street" wildcard="2">
<definition type="options" connectiontype="db" sort="asc">
<dsn encoding="UTF-8">pgsql://user:pass@localhost/db_name</dsn>
<sql>SELECT DISTINCT street_id, street_name FROM
buildingaddress WHERE street_name IS NOT NULL ORDER BY street_name</sql>
<events>onchange="resetSuggestCache();$('#pmsfld_street_name').val('')"</events>
</definition>
</field>
<field type="s" name="building_number" description="Number"
wildcard="2">
<definition type="suggest" connectiontype="db" sort="asc"
minlength="1" dependfld="street_id" nosubmit="1">
<dsn encoding="UTF-8">pgsql://user:pass@localhost/db_name</dsn>
<sql>SELECT DISTINCT building_number FROM buildingaddress WHERE
building_number ~* '^[search]' {and street_id = '[dependfldval]'} ORDER BY
building_number</sql>
</definition>
</field>
</layer>
</searchitem>
It works! : )
As I don't want these data to be listed in the TOC, I have only mentionned
its group name in the ALLGROUPS tag of the config file, and not in a
CATEGORY tag. Works fine!
Now I would also like to avoid the query result table (pmQueryContainer) to
appear when the Search button is hit.
1) Is there a parameter to add in the search.xml, so that pmQueryContainer
doesn't show up?
If not, according to dialog.css, pmQueryContainer default style is
display:none, an idea could be to let it like that instead of showing it
with display:block.
Another idea could be to run $("#pmQueryContainer").hide() along with the
hit of the search button.
2) Would that be feasable only for that specific query? Which files would I
have to modify?
Finally some general questions about attributes search:
3) From my tries, it looks like the 'suggest' type doesn't accept a
keyfield and a showfield parameter. Am I right?
4) Accordingly, the 'options' type doesn't deal with a 'dependfld'
parameter. Right?
5) Actually I would like to have a first field with the 'suggest' type and
a second field (depending on the first field) with the 'options' type. But
I didn't see any example like that. Probably because of point 4) above.
Isn't such a query supposed to be set up in pmapper 4.2?
Thanx in advance for your help or ideas!
BaK
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
pmapper-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pmapper-users