View Full Version : AbstractComponent.rendered set too early

13 Jun 2011, 3:33 AM
At the end of AbstractComponent.onRender me.rendered is set to true. Consider a component that extends a subclass of AbstractComponent. This component overrides the original onRender-method:

onRender: function(ct, pos) {

After this.callParent(arguments) this.rendered is true, but it shouldn't be before the end of all rendering, that is until the moment when the 'render'-event is fired. If the component is a form field and the code in this.setValue(this.value) depends on the field being rendered (which is common), the code will fail, because at the time setValue is called, rendered is already true, but rendering has not finished.

I suggest this.rendered is set true in AbstractComponent.render just before the 'render'-Event is fired.

19 Jun 2011, 10:23 PM
Has this been seen by sencha people? Any comments on this? Thanks.

21 Oct 2011, 7:17 AM
Another attempt to get attention for this. onRender seems to be a method that is commonly overridden in subclasses and I would rendered to be false while onRender is running.

Comments please?

15 Jul 2012, 10:47 PM
Still a problem in 4.1. rendered is set true in onRender, but as I understand it, onRender is a template method that is meant to be overridden, so it should not set a flag that is part of the template skeleton. As far as I am concerned, this is a bug, but easy to fix, and I would like to try again to draw attention to it.