Hi,

You should try to defined a <sql_where> in <layer>
<sql_where>hospric = '[hospric]'</sql_where>

Thomas

Armin Burger a écrit :
> Marco
>
> Currently *all* form elements (fields) are used for the query string.
> Using one of them just for defining the depending field values but
> excluding them from the query string composition is not foreseen
> currently. This will require additional settings predefined in  XML
> that is read by PHP and then passed over to Javascript. So nothing
> done in 5 minutes.
>
> You can add a ticket in the Trac system (svn.pmapper.net/trac) of type
> 'enhancement'. Use the 'Register' link to create an account. I know
> people practically never do that, so most enhancement proposals via
> the mailing list will be discarded because I'm usually not going to
> follow them up any more if not added in Trac.
>
> For a quick and dirty solution:
> I'm currently not sure how the [search] place holder is substiuted for
> SQL queries, I guess it replaces them in the order how the fields are
> defined in the XML. A quick solution could be to try to 'hide' the
> value of the first [search] in the query string so that it is not
> executed, e.g.  by putting them inside a comment, like
>
> <sql>SELECT DISTINCT [dependfldval] FROM
> [7 HOSPITAL]  WHERE  /* [search] */ [dependfldval] LIKE '%[search]%'</sql>
>
> armin
>
> On Wed, Nov 25, 2009 at 10:34 AM, Marco <marc...@katamail.com> wrote:
>   
>> Hi,
>>
>> First I want to compliment for Pmapper's quality code, it's difficult
>> to find applications so well written!
>>
>> Now my problem: I have to add a select when the user chooses the field
>> on which to search, and I wrote the XML:
>>
>> <searchitem name="hospital" description="Hospital">
>>               <layer type="ms" name="hospital">
>>                   <field type="s" name="hospfield" description="Field
>> to search" wildcard="2">
>>                       <definition type="options" firstoption="Select"
>> connectiontype="inline">
>>                           <option value="NAME" name="Name" />
>>                           <option value="ADDR" name="address" />
>>                           <option value="CITY" name="City" />
>>
>> <events>onchange="$('#pmsfld_hospric').val('')"</events>
>>                       </definition>
>>                   </field>
>>                   <field type="s" name="hospric" description="Search"
>> wildcard="2">
>>                       <definition type="suggest" connectiontype="db"
>> sort="asc" minlength="2" dependfld="hospfield">
>>                           <dsn
>> encoding="UTF-8">odbc://'':''@localhost/datahosp</dsn>
>>                           <sql>SELECT DISTINCT [dependfldval] FROM [7
>> HOSPITAL] WHERE [dependfldval] LIKE '%[search]%'</sql>
>>                       </definition>
>>                   </field>
>>               </layer>
>>   </searchitem>
>>
>> I logged the results and it working properly, except that it submit
>> also the field hospfield, I also tried with the xml attribute
>> "nosubmit" but doesn't work, what's the best way to solve it?
>>
>> thanks
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
>> trial. Simplify your report design, integration and deployment - and focus on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> pmapper-users mailing list
>> pmapper-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>>
>>     
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> pmapper-users mailing list
> pmapper-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>
>
>
>
>
>   
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to