Startbeitrag von DanM am 07.04.2012 19:30
I know it exists in WinDev but I cannot find it ... Is it in WnDev 16 ?
I want to be able to display a list of items that meets the criteria already typed in by the user and every time they type more in to narrow the options of the choices available. If they backspace it should expand the options which meet the criteria. Simular to ...
Autocomplete
As you type within the search box on Google, our autocomplete algorithm offers searches that might be similar to the one you're typing. Start to type [ new york ] -- even just [ new y ] -- and you may be able to pick searches for "New York City," "New York Times," and "New York University" (to name just a few).
Any Suggestions or Direction greatly appreciated !
Thanks ... Dan
I want to be able to display a list of items that meets the criteria already typed in by the user and every time they type more in to narrow the options of the choices available. If they backspace it should expand the options which meet the criteria. Simular to ...
Autocomplete
As you type within the search box on Google, our autocomplete algorithm offers searches that might be similar to the one you're typing. Start to type [ new york ] -- even just [ new y ] -- and you may be able to pick searches for "New York City," "New York Times," and "New York University" (to name just a few).
Any Suggestions or Direction greatly appreciated !
Thanks ... Dan
I want the user to be able to select from the options in a drop down (or popup ) OR create a new record when no options meet the criteria
von DanM - am 07.04.2012 19:40
?? Have not tried it myself...
von A Bonds - am 07.04.2012 20:18
I have been working with the Combo box but was trying to accomplish this like google does with a Edit control and a dropdown / popup ... as I need to display not only the company name but also ... City State & zip code
Let me know if you have any other ideas ...
thanks for your input
Dan
von DanM - am 07.04.2012 20:45
The "assisted input" option for edit controls, available in the Details section of the control editor works very well if the control can be linked to an indexed file field.
Combo and list boxes are another matter. The inbuilt search options in these is either broken or poorly executed in Windev. The problem, and it has always been a problem, is that with some combinations of data the inbuilt combo box search works and with others it doesn't.
The best way around it that I have found is to put a small edit control to the left of the combo box control and encourage the users to use that as a search mechanism when the one in the combo box doesn't work. You can use the data entered into the search edit control to do a listseek() in the combo box. Place this code in the "When modified" event of the control and it will respond to all the keystrokes as the user enters them and search in the como box
Regards
Al
von Al - am 08.04.2012 00:02
Once again, I appreciate your input, especially about the combo boxes. After investing several hours I could not come up with a consistent behavior or one I liked.
It looks like WD17 has what I am looking for in #128. (I think)
After several hours I did manage to come up with a solution which behaves just like the Google Suggest search box using a edit control. It involves a small multi-column table and timers.
If any one would like the details ... let me know.
After all the support many of you have given me ... I would like to give back if anyone is interested.
Thanks ... I alway value the opinions, input and experiences of others on this forum.
Dan
von DanM - am 08.04.2012 23:48
I am highly intrigued by your workaround - I have WD16 and this was one of the crucial items that forced me away from WD and back to Clarion (i.e. lack of intelligent picklists for data entry fields). I just read throught the WD17 "new features list" and it appears promising that PC Soft might have addressed this problem, but I dislike spending 399 Euros to find out the truth... hence my strong interest in your solution :)
Does your solution also allow the enduser to add/edit/delete database records in the lookup table "on the fly" (something that has been standard in my Clarion apps for a decade) ?
Cheers,
Scott
von Scott Daughtry - am 09.04.2012 21:05
Here is the code ...
-----------------------------------------------------------------------------------------------------------------
//Start the Timer Procedure when you enter the Edit Field which you want to do the look up on (EDT_CompanyName), run it every 1/2 second
gnTimer_GStyleSelection = Timer(Timer_TakingaRequest_FindCompanies,50)
---------------------------------------------------------------------------------------------------------------------------------------
//This is the procedure which runs every 1/2 second once you are in the EDT_CompanyName field
PROCEDURE Timer_FindCompanies()
// If the length of the Company Name is greater than 2 and the length of the Company Name is different than it was 1/2 second ago ...
IF Length(EDT_CompanyName) > 2 AND Length(EDT_CompanyName) gnPreviousLengthOfSearchField THEN
// Change the previous length to the new length
gnPreviousLengthOfSearchField = Length(EDT_CompanyName)
//Clear the table and the Query
TableDeleteAll(TABLE_GStyleSelection)
HCancelDeclaration(QRY_Companies)
// Make the look up table visible and position it directly below the Edit Field (EDT_CompanyName)
TABLE_GStyleSelection..Visible = True
TABLE_GStyleSelection..X = 720
TABLE_GStyleSelection..Y = 505
// Run the Query used to fill the Table
QRY_Companies.Param_CompanyName = NoSpace(Upper(EDT_CompanyName))
HExecuteQuery(QRY_Companies)
// Display the Query Results to the table
FOR ALL QRY_Companies ON QRY_Companies.CompanyID
TableAddLine(TABLE_GStyleSelection,QRY_Companies.CompanyName + " - " + QRY_Companies.ZipCode,QRY_Companies.ZipCode,QRY_Companies.CompanyID)
END
TableDisplay(TABLE_GStyleSelection,taStart)
END
-----------------------------------------------------------------------------------------------------------------------------------------
// In the Row Entry of the Table (when you click on a row in the table)... Stop the timer
EndTimer(gnTimer_GStyleSelection)
-----------------------------------------------------------------------------------------------------------------------------------------
//In the Left Double-Click of the Table, when you select the Company Name
gnCompanyID = TABLE_GStyleSelection.COL_ItemID
IF gnCompanyID > 0 THEN
// Display the Company Name to the edit field (EDT_CompanyName)
EDT_CompanyName = NoSpace(ExtractString(TABLE_GStyleSelection.COL_Name,1," - "))
EndTimer(gnTimer_GStyleSelection)
//Make the lookup table invisible and reset the length of LookUp Item zero
TABLE_GStyleSelection..Visible = False
gnPreviousLengthOfSearchField = 0
END
==========================================================================
If any of this is unclear ... let me know and I will try and be more clear
von DanM - am 10.04.2012 04:35
I Made a similar code in WD 16, but I put the Hexecutequery in the Whenever modified EDT_Search, just curious about the timer?
And I just made the switch from clarion (Where I had to manually build this type of search to and there I had to use timer)
Whenever modifyed Edt_search
sSString is string
sSString = Upper(EDT_Search)
QRY_Search_kunde.pKNavn = sSString
Trace("QRY_Search_kunde.pKNavn: '"+QRY_Search_kunde.pKNavn+"'")
//QRY_Search_kunde.pKundenr..Null = True
HExecuteQuery(QRY_Search_kunde)
TableDisplay(TABLE_QRY_Search_kunde)
Cheers
Tor-Bjarne
von Tor-Bjarne - am 10.04.2012 10:07
Re: WD16 - AutoComplete, Auto Search, Auto Suggest, Auto Fill ?? Does it Exist? (no replies)
- Assisted input
- History of inputs
Is it this what you are looking for.
Message forwarded from pcsoft.us.windev
von Roy van der Lee.pcs.crosspost - am 11.04.2012 06:01