Article View: borland.public.jbuilder.java.swing
Article #9004Re: jdbNavComboBox and eventhandling?
From: Paul Furbacher [TeamB]
Date: Tue, 30 May 2000 00:00
Date: Tue, 30 May 2000 00:00
34 lines
2288 bytes
2288 bytes
"RenοΏ½ Thomsen" wrote: > > I want to use the user to type in a letter and when he has typed the first > letter, i search in a field. > When he types a new letter a new search is done, removing all other > entitites. > Have tried to set the components dataset to null to remove items, nowork, > aswell as refreshing the query (with new sql) bound to the component, dosent > work either. > i could use a regular combobox and fill it with strings, however this takes > forever(strange). For this purpose, I'd say that a JdbNavComboBox isn't what you want. There are several ways I'd approach this. My first approach would be to extract the values of that one column into either an array or Vector. Then, when a user types a character, iterate through that collection, asking whether each String in it "startsWith(character)". If so, add it to a vector which will be assigned as the model of an ordinary JComboBox after the iteration: DefaultComboBoxModel has constructors for both array and Vector, if I remember correctly. By building the model and then assigning it, updating the combobox list goes faster. I don't know how fast this will be, but if the number of rows in the dataset isn't to big, it might be sufficiently fast as to not annoy your users. You might look at using some kind of combination of DataSetViews and dataset filtering -- but I haven't used this often enough to say whether it would work. Paul Furbacher (TeamB)
Technical Details
Message-ID:
<393423F4.E03E92EE@home.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8fgtpv$iot2@bornews.borland.com> <391C19C5.3396C61C@home.com> <8fooi3$3vn4@bornews.borland.com> <8frjep$2jk2@bornews.borland.com> <39218A91.C2AA5613@home.com> <8g0jhn$k8m2@bornews.borland.com> <39242251.BD56C652@home.com> <8gt6ta$geo2@bornews.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111d45,e90c7079d92d94ee X-Google-Attributes: gid111d45,public From: "Paul Furbacher [TeamB]" <pnf@home.com> Subject: Re: jdbNavComboBox and eventhandling? Date: 2000/05/30 Message-ID: <393423F4.E03E92EE@home.com> X-Deja-AN: 629159400 Content-Transfer-Encoding: 8bit References: <8fgtpv$iot2@bornews.borland.com> <391C19C5.3396C61C@home.com> <8fooi3$3vn4@bornews.borland.com> <8frjep$2jk2@bornews.borland.com> <39218A91.C2AA5613@home.com> <8g0jhn$k8m2@bornews.borland.com> <39242251.BD56C652@home.com> <8gt6ta$geo2@bornews.borland.com> X-Accept-Language: en,pdf Content-Type: text/plain; charset=iso-8859-1 Organization: Reverse Alchemy, Inc. Mime-Version: 1.0 Reply-To: pnf@home.com Newsgroups: borland.public.jbuilder.java.swing