This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Combo boxes update

 
Axel Leucht
Greenhorn
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?
 
pramod karnani
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.


Thanks
pramod
 
Roel De Nijs
Sheriff
Posts: 10594
143
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • 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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic