Updating UI Architecture

Hello Vaadin Guys,

im developing a little Game with this excellent framework, but I got an issue in my Architecture for updating my UI.
Im working with:
SQLContainer
and
CustomComponents
.
I visualize my problem with my excellent paint skills :grin:


VarValue as a Label in CustomComponent 2 shall realize the update initiated by CustomComponent 1.
Character instance is filled with informations by the SQLContainer.

So I’ve got these ideas:

  1. Maybe my SQLContainer could realize when something has changed?
  2. My Character instance could recognize it through setter, but then it has to be static with my application instance.

then my CustomComponent 2 has also recognize that it has to repaint…

Could you give me some suggestions? I read a lot in the book and forum, but still dont know how to do it the best way.

greetings,

you probably want to use a server push component like
Refresher

You add the refresher in the container that is the parent of Custom Component 2.
you could set the refresh interval to a value you like or only enable it when you want a refresh and disable it again after an update.
Perhaps create a worker thread to update at intervals is something that would be handy in your case.

I do not have the time at this moment to give examples but if you look add push addins there are examples to be found also.
good luck with your project.

Thanks for your Reply,

I read about Refresher already and now I know it fits for me. Ive got two Questions left:

  1. I will refresh the SQLContainer in CustomComponent 2 with the Refresher addon, but will this also update my Label containing some Information of an Itemproperty?
    Maybe If I connect the Labels with the Itempropertys instead of cast them to String?

  2. If I do this multiple times I will generate a lot of “refresh” threads. Maybe I should create a singleton Thread with a List of my containers to refresh. Good approach?

Best wishes