Rendered Function

I had a very basic question. I always assumed that the rendered function in any kind gets called once all the components gets rendered on the DOM. Is it incorrect if the function is getting called multiple times? I am creating components Dynamically by using createComponent function which in turn creating more components Dynamically? I wanted to run a few functions after the components are rendered but I saw those functions getting called multiple times.

Comments

  • The behavior you are assuming stems from the initial rendering of the kind. rendered is called whenever a control is output into HTML, usually via a render or renderInto call. Are you calling this.render() after each createComponent call, or something to that effect? That would cause rendered to be called multiple times for the given kind, and in general you would want to wait until creating all your components and then making a single render call.
  • Thanks for your help .... understood the issue
Sign In or Register to comment.