I have a database table like this
Port Code | Country |Port_Name
--------------------------------------
1234 | Australia | port1
2345 | India | Mumbai
2341 | Australia | port2
...
The table consists of around 12000 entries.I need to auto-complete as the user enter’s the query.Now the query can be any either a port-code,country or a port name.For example if the users partial query is ’12’ and the drop-down should display 1234 | Australia | port1.The problem that i’m facing now is that for each user entry i’m querying the database which makes the auto-complete really slow.So is there a way to optimize this ?
in smartgwt use comboboxitem.Then override getPickListFilterCriteria of comboxitem like this
Every key press will give you a criteria which u can pass to your query.Query will be something like
select * from port where portName like '+criteria+%' or portCode like '+criteria+%