How to wait until all characters are entered?
-
I am programming for Windows Mobile 6. I am writing an application. Here is the design: 1) A textbox for user to scan a barcode. 2) After scanning, automatically call web service to search the database. 3) If found data, display in a table below. To solve 2, I use text1_TextChanged(). However, as the barcode is long (some 11 characters), the TextChanged() function is called more than 11 times. That means the database is searched for more than 11 times. The performance is too slow. I have searched the web and find out this: .NET — Textbox control - wait till user is done typing[^] I use the timer approach, but find out the tick function is called 11 times. Any help? (Please note that the barcode is scanned in, not typed in.) [Edited at 2012-08-16] The project is a bit complicated now. The textbox could hold any number of characters from 4 to 24. So I cannot just count to the end. If I start querying the database once I have at least 4 characters, I could end up with searching 20 times...
-
I am programming for Windows Mobile 6. I am writing an application. Here is the design: 1) A textbox for user to scan a barcode. 2) After scanning, automatically call web service to search the database. 3) If found data, display in a table below. To solve 2, I use text1_TextChanged(). However, as the barcode is long (some 11 characters), the TextChanged() function is called more than 11 times. That means the database is searched for more than 11 times. The performance is too slow. I have searched the web and find out this: .NET — Textbox control - wait till user is done typing[^] I use the timer approach, but find out the tick function is called 11 times. Any help? (Please note that the barcode is scanned in, not typed in.) [Edited at 2012-08-16] The project is a bit complicated now. The textbox could hold any number of characters from 4 to 24. So I cannot just count to the end. If I start querying the database once I have at least 4 characters, I could end up with searching 20 times...
I may be wrong about this (I have no experience with Windows Mobile), but isn't there any way to check for how many characters have been entered in the text field? I mean, you said the barcode is some 11 characters, but does it have any lower bound? (for instance, it can't be shorter than 8 characters). Then, when it reaches the lower bound, you can start querying the database from there. Also alternatively, instead of querying the database automatically when the code is scanned, you could add another button for a manual scan - when the user finishes scanning the barcode and the textfield is completed, show him another button to do the search and display the results in the table. In this case, there is another click for the user, but I think the performance benefits far outweigh the usability drawbacks
Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.
-
I may be wrong about this (I have no experience with Windows Mobile), but isn't there any way to check for how many characters have been entered in the text field? I mean, you said the barcode is some 11 characters, but does it have any lower bound? (for instance, it can't be shorter than 8 characters). Then, when it reaches the lower bound, you can start querying the database from there. Also alternatively, instead of querying the database automatically when the code is scanned, you could add another button for a manual scan - when the user finishes scanning the barcode and the textfield is completed, show him another button to do the search and display the results in the table. In this case, there is another click for the user, but I think the performance benefits far outweigh the usability drawbacks
Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.
Hi Andrei, I cannot start from the lower end. The number of characters now could range from 4 to 24. So if I start off with lower bound - 4 characters, I could end up checking the database 20 times. Of course, I know the solution to add the button to manually trigger the checking of database, but I still want to have the automatically checking.