View Full Version : Access to and refresh of the viewport from a controller

9 Oct 2011, 9:05 PM
I would like to refresh the Viewport (such that my onViewportRendered function gets called) from within a controller. The following code would get executed from an application event within one of the controllers.

This code fails with an error that the viewport does not have a function doLayout - I'm probably missing something really simple...

// Refresh the viewport
var viewport = this.application.getView('Viewport');
if (!viewport) {
console.warn('AppStarter.js onAccountAuthorization - The viewport is not available - this should not happen.');
else {
console.log('AppStarter.js onAccountAuthorization - The viewport is available - refresh the viewport.');