Xojo2023 - WebSearchField.TextChanged event

Is there a way to control time delay between key strokes in the search field triggering TextChanged event?

What I need is to trigger TextChanged without using Enter/Magnifying glass but don’t want to do it for every single character typed. In other words, when “abc” is typed quickly then I want to use “abc” in search rather than having search done after every character typed in.

use a timer with 3 seconds or something like that. restart the timer every time the event fires.

I already have timer for executing query and building list of database server. Can I have more than timer per webpage?

Yes, of course

How would you trap the click on the X on WebSearchField that clears the content?

Btw, I have added second timer to the page and the search now happens after preset number of seconds. Still trying to figure out if this delay should be in user control or not (just to allow longer entries).

If you want to have that event, you will have to create you own Control or do some tricks with Javascript.
The easiest way would be to handle that in your TextChanged event. Create a property, write the content of your search control everytime TextChanged accours in the property. If there is a string in the property and next time it is empty this could be because of the “x”. But that is not guaranteed. Could be a short string that was deleted “by hand”.

I’m also having an issue with trapping the “x”. It fires the Pressed event but the .Text property does not change. Also, the TextChanged event does not fire and a Timer watching the .Text property does not see any change. If the Search icon is then pressed, it sees .Text change to empty. Seems like a bug.

There was a reported bug by @Louis_Brauer1, related to the “x” button, that will be fixed in 2024r1:
https://tracker.xojo.com/xojoinc/xojo/-/issues/75316

Great, thank you for confirmation of the bug with “X” icon on the WebSearchField.

One more observation. I have noticed that using Bootstrap “Hero” theme the tooltip comes up all with upper case. It doesn’t look nice. I would prefer the tooltip to be mixed case, small italics would be even better.

You can create a new post with this, put the URL to that “Hero” theme and someone will tell you if you need to modify the theme or is something that Xojo needs to fix.