java - Listing items in Combobox -


i trying create titleareadialog in jface. have text field username entered , combobox selecting group of user. requirement that, when type username in first text field, combobox should show groups corresponding username (there table in database each username assigned set of groups). have written code retrieving groups corresponding username entered. not getting list of groups in combobox.

should add listeners textbox or combobox once type username in textfield, list of groups corresponding username in combobox?

kindly me new topic , java well.

text = new text(composite, swt.border); text.setbounds(205, 10, 109, 19);  combo combo = new combo(composite, swt.none); combo.setbounds(205, 49, 109, 21);  string reponame=text.gettext(); string[] grpnames=db.getcombovalues(reponame); combo.setitems(grpnames); 

you can add modifylistener text widget , re-populate combo box on every change so:

text.addlistener( swt.modify, new listener() {   @override   public void handleevent( event event ) {     string reponame = text.gettext();     string[] grpnames = db.getcombovalues( reponame );     combo.setitems( grpnames );         } } ); 

this cause database request whenever text changes. depending on how long query takes, may render ui unusable.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -