On 21/07/2011 22:24, Pedro Venâncio wrote:
> Hello Armin,
>
> Thank you very much, that was it, I was missing the [search] parameter. Now 
> it is working properly!
>
> I enabled the error_log in php.ini, and now I have access to pm_debug.log, 
> but can not find the file config.ini to set the debuglevel to 3. Where can I 
> find it?
>

this is an old reference to the old config file type. Now it's 
config_whatsoever.xml (not *.ini any more). I will need to update the 
docs ;-) the default value of the release versions is 3 and produces 
verbose debug info.

> While on the subject, I have a doubt to create a dropdown search (type = 
> "options"), to display only distinct results. The case is the following, I 
> have a postgis table with an ID column ("gid"), a column "Name", and a set of 
> other columns. The column Name has repeated entries and the dropdown shows 
> all these entries. This is the searchitem I'm using
>
>      <searchitem name="plantas_emitidas" description="Plantas Emitidas">
>          <layer type="postgis" name="plantas_emitidas">
>              <field type="s" name="gid" description="Local" wildcard="2">
>                  <definition type="options" connectiontype="db" sort="asc">
>                      <dsn 
> encoding="UTF-8">pgsql://postgres:password@localhost/pmapper_postgis</dsn>
>                      <sql>SELECT DISTINCT gid, name FROM plantas_emitidas 
> WHERE name IS NOT NULL ORDER BY name</sql>
>                  </definition>
>              </field>
>          </layer>
>      </searchitem>
>
>
> It shows all Names from the table, but I'd like that just showed up one of 
> each. I tried to enter the parameter GROUP BY,
>

I'm not sure if the docs make it clear, but for OPTIONS the first field 
from the query is used for the (not visible) "value=..." element of the 
<option>, the second field for the *displayed* text. Between both there 
should be a 1-to-1 relation, otherwise it makes not much sense to me.

In your case you have multiple gid's for the same name, so a distinct on 
both returns the unique combinations of both, probably not what you 
want. I mainly defined it like that so that the search can be run on an 
integer field while the display in the browser is the corresponding 
text. In your case I would define it like

<field type="s" name="name"
     ...
     <sql>SELECT DISTINCT name, name FROM ...

which will create HTML code like

<option value="Rome">Rome</option>

and it will search the DB table for the "name" field.

Armin



------------------------------------------------------------------------------
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can 
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to