Thanks for the tip catching the paste action - this is one thing I had not 
handled.

This is what I use for with all list boxes regardless of output listing form, 
or related record display on an entry form
(for user typing)
- user starts typing - timer set to a small value (I forget what exactly, as I 
am at home)
- user stops typing for longer then timer value, or user exits the entry area 
(click or tab)
- On timer runs, does Query Selection with 'containing value' entered (all 
queries are applied against current display)
- user clears criteria entry area - original (starting) selection is returned

I do not compare, previous vs current entered text

I do not query against all possible fields, I let the user select the field 
from a popup menu, with a default.
I give the user an option for a 'complex' query (based on fields allowed to be 
queried) where they can build a query such as:
A contains "Fred" & 
B = 12 & 
C > 12/21/18
 I also give them access to 'expert' (mostly for myself) which is 4D's native 
query dialog (again query selection) on the base table.


> - catch the on after edit event and put the query string (get edited 
> text) into a (hidden) variable 1
> - set timer (in my experience, a short timer does the trick, e.g. 3 ticks)
> - in the on timer event, compare the value of the hidden variable 1 
> to the value of hidden variable 2
> 
> If the content of variable 1 is the same as variable 2 put the timer 
> to zero and perform the query;
> Else, put the content of variable 1 into variable 2 and keep the 
> timer running (user is still typing).
> 
> Works well, I use this technique in all my selectors:
> 
> https://flury-software.ch/a-swiss-army-knife-for-4d/
> 
> e.g. in the home section of the explorer have a look at the folder 
> "PopUp Selector"
> 
> To see the poup in action, execute the method "UI_Test". It first 
> parses a 60000 row address file (uncompiled it takes some seconds, 
> compiled is much faster) in order to prefill the popup in the test 
> form. Selecting an address is very fast, even with a multi criteria 
> search, e.g. "paul alvarez". The test form also demonstrates the use 
> of the other selectors.
> 
> Olivier
> 
> -----Ursprüngliche Nachricht-----
> Von: 4D_Tech <[email protected]> Im Auftrag von Chip 
> Scheide via 4D_Tech
> Gesendet: Samstag, 20. Juli 2019 00:38
> An: [email protected]
> Cc: Chip Scheide <[email protected]>
> Betreff: Re: How to Catch Paste Action
> 
> Thanks!
> 
> I need the timer to trigger the lookup -
> ex: 
> Criteria -> Fred <user stops typing for .5 sec> execute lookup on 'Fred'
> 
> want to do the same with pasted data 
> 
> 
> 
>> Chip,
>> 
>> Try using On After Edit event in your enterable object. That should 
>> work without involving On Timer event. However, you will need to use 
>> Get edited text command to get the data.
>> 
>> HTH,
>> Add
>> 
>> 
>> 
>> 
>> On 7/19/19, 2:59 PM, "4D_Tech on behalf of Chip Scheide via 4D_Tech" 
>> <[email protected] on behalf of [email protected]>
>> wrote:
>> 
>>     I have a variable in which the user enters search criteria.
>>     They can paste from elsewhere also (as it is just text).
>> 
>>     everything works as I want when typing, but nothing happens when the
>>     user pastes, until they tab or click outside of the entry area.
>> 
>>     I would like to catch the paste action, and set a timer (which is what
>>     happen with typing), to trigger the search.
>> 
>>     Thanks
>>     Chip
>>     ------------
>>     Hell is other people
>>          Jean-Paul Sartre
>>     **********************************************************************
>>     4D Internet Users Group (4D iNUG)
>>     Archive:  http://lists.4d.com/archives.html
>>     Options: https://lists.4d.com/mailman/options/4d_tech
>>     Unsub:  mailto:[email protected]
>>     
>> **********************************************************************
>> 
>> **********************************************************************
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:[email protected]
>> **********************************************************************
> ------------
> Hell is other people 
>      Jean-Paul Sartre
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************
> 
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************
------------
Hell is other people 
     Jean-Paul Sartre
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to