Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Combo boxes update

Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do searching for rooms (I'm doing the UrlyBird assignment) with two combo boxes for location and name respectively.

I might happen that the combo boxes don't display the current state in the database. This might happen e.g. when another client created a room in a new location. The new location isn't among the model for the location combo box. That's why I made the combo box editable. I load the combo boxes initially at application startup and as id is only possible for the client to search and book/release a room I didn't thought about it very much.

But I do wonder if an editable combo box is sufficient and I like to ask on how you do cope with this situation?
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Axel,

In my instruction.html is written "
You may assume that at any moment, at most one program is accessing the database file".

So if application is already running , means database file is already in use so even some changes in the database file occur there is no need to update combo boxes but once you restart the application then combo box will be updated.
I do not know is it written in your instruction or not.

Still you fill that there should be update of combo boxes then you can provide Refresh button in your GUI that will do database trip and update the combo boxes .

Thats what I can suggest.

Posts: 11604
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pramod,

What Alex means, is something else (i gues): if you have 2 different networked clients and the second one adds a new room/contractor, how will the combo boxes get refreshed, adding the newly added room/contractor.

Alex, correct me if you meant something else.

Allowing user to choose an item from combo or enter some text, is imho a good alternative. Maybe a refresh button after each combo to refresh its content, is also a good approach...
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic