(posted this earlier in the community Q&A forum, before we had a support license)
I'm trying to save the state of some components in a cookie (particularly checkboxes, but it could be anything later on). However, I have a hard time getting it to correctly initialize the checkbox when reloading the application: it seems AbstractComponent adds a stateEvent listener for the resize event, causing the component to save it's state ("unchecked") *before* it's state has been restored.
So, it correctly saves it's state to the cookie, but when I reload the page in my browser, it doesn't restore it, because it's overwritten before it gets a chance to.
I've seen a suggestion to override the constructor of AbstractComponent, but surely that can't be the way to go with this...
Another thing that bothers me is that the default value of the "stateful" property is true. This means that by just adding a state provider, all kinds of components suddenly start storing and restoring their state, even components that have been generated by others, so I don't have control over their state behaviour. This can be remediated by overriding the stateful property of all components: