Where to store `UI`-object scoped state in a Vaadin 14 app?

前端 未结 1 1142
隐瞒了意图╮
隐瞒了意图╮ 2020-12-20 09:44

Context (web app)

To store state available to our entire Vaadin app, we can get and set \"Attribute\" on the VaadinContext object that represents our entire Vaadin

相关标签:
1条回答
  • 2020-12-20 10:14

    In Vaadin Flow there is ComponentUtil helper class which has methods to store data with components and UI.

    See the pair of ComponentUtil.setData methods, one taking a Class as key, the other taking a String as key, just like the getAttribute/setAttribute methods found on VaadinContext & VaadinSession.

    0 讨论(0)
提交回复
热议问题