Yes, that is in fact what I’m doing.  And I know it works because it fills in 
the rest of the name I want after i type in the first letter.  The problem is, 
it won’t let me highlight the new text that was entered so that if I type 
another letter it replaces the highlighted text.  So for example:  In my data 
set I have:


When I type “A”  “Apple” appears in my cell, and I want the “pple” to be 
highlighted so that if I type “r” it replaces it and what I have typed is now 
“Ar” and “arugula” would appear with the “ugula” highlighted.
The problem is that HIGHLIGHT TEXT does not appear to be working in the listbox 
cell like it would on a form variable, and so what I get is “Arpple” and then 
when I tab out it says that word doesn’t exist (when the on data change code 
runs to do the verification”

Does that make sense? 


> On Apr 11, 2019, at 11:54 AM, Kirk Brooks via 4D_Tech <> 
> wrote:
> Doug,
> I believe you want to use the On after keystroke form event on the listbox
> (or the column) and the Get edited text function. Get edited text returns
> the text that's being edited before it's saved to the object it's edited
> in.
> On Thu, Apr 11, 2019 at 8:35 AM Doug Cottrill via 4D_Tech <
>> wrote:
>> Hi all,
>> I’m trying to implement a type-ahead feature in an array listbox cell.
>> I have this functionality in a form variable, and it works great- when the
>> user types, code in the on after edit finds the first record value in a
>> field that matches the first few characters, fills in the rest, and
>> highlights the new characters so that if the user continues typing the item
>> found can be replaced.
>> The problem I’m having is that apparently in a listbox, you cannot call
>> highlight text on a cell to highlight partial text.
>> So, first off- am I correct that HIGHLIGHT TEXT will not work in a
>> listbox?  If it WILL work, can someone post code since mine is not working,
>> and it “should” as far as I can tell, but the docs say it will not work in
>> a subform field.  I don’t know if a listbox qualifies or not, but it seems
>> to.
>> Second, assuming that HIGHLIGHT TEXT does NOT work in a listbox, how are
>> others doing type-ahead in a list box?  Surely I’m not the first person to
>> want to do this?
>> Thanks
>> **********************************************************************
>> 4D Internet Users Group (4D iNUG)
>> Archive:
>> Options:
>> Unsub:
>> **********************************************************************
> -- 
> Kirk Brooks
> San Francisco, CA
> =======================
> What can be said, can be said clearly,
> and what you can’t say, you should shut up about
> *Wittgenstein and the Computer *
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:
> Options:
> Unsub:
> **********************************************************************

4D Internet Users Group (4D iNUG)

Reply via email to