0

Is there any way to detect all Vaadin components, html, elements are loaded and rendered in UI. For devMode in browser console

... com.vaadin.client.communication.MessageHandler
INFO: Referenced paintables: ...

as info.

After this i want to push something to UI.

Vaadin version: 8.0.5, spring boot 1.5.2

tsogtgerel.ts
  • 955
  • 1
  • 15
  • 32

2 Answers2

0

There are two ways in Vaadin to update your UI asynchronously: polling and push. Basically, you initialize your application with the basic data and start the background threads that calculate additional data. Once calculation is done, you can update components accordingly and Vaadin will pull from client periodically (if you use polling) or push to client (if you use server push). Don't forget to wrap your calls with UI.access method when accessing components from the background thread.

Steffen Harbich
  • 2,639
  • 2
  • 37
  • 71
  • Thank you Steff, The problem is base initial need 300ms, additional Threads need each 100-500ms. What i nees is user see after 300ms UI with base data, shorty after (not after 100ms, because is allready done and waiting UI base initial done status) next additional data. Generaly all process and UI update must in 500ms done. – tsogtgerel.ts Apr 28 '17 at 00:59
  • So my proposal should work. After your base initialization Vaadin will answer the HTTP request and the browser will render the response. Just play around a bit with the polling or push, you will see. – Steffen Harbich Apr 28 '17 at 08:38
0

Dirty workaround: If you have a focusable component on your page you can abuse .addFocusListener() and .focus(). The focus event only fires after the focus was placed on the component and that's after the page is rendered. Then off course set a flag that your event handler does not re-execute if the focus returns to the same component.