ViewControllers do not invoke the render event on their views, is this by design?

edited October 2013 in Enyo 2.4
A view tied to a controller by the view property does not raise it's render event. The ViewController does call it's render event. Is this by design?

http://jsfiddle.net/dposin/yPDLx/

Comments

  • The ViewController calls renderInto(), not render(), because it's rendering the View into a specific DOM element. There's no "render" event, render is just a method of enyo.Control.
  • Interesting. I changed the event handler for the view to be renderInto. However, the application (ViewController) is using the render event. If I change the view controller to renderInto it breaks. So it looks like the viewcontroller renders with the render event automatically but calls the renderInto function on the view instead of render. I updated my fiddle to show the difference in events. If you switch the viewcontroller to renderInto, only the view gets called.

    Could the ViewController using render but the view it contains calling renderInto cause confusion?
  • There is no standard "render" event. There are only renderInto() and render() methods that can be overridden.

    Looking more at the ViewController code, the method "render" on ViewController will either use renderInto() or render() on the associated view depending on if the view has already been rendered into the DOM.

    There's no renderInto() method on ViewController because the rendering target is controlled by the renderTarget property, not by what you pass into a call.

    Your updated fiddle is running as I would expect it to.
Sign In or Register to comment.