Can a widget change the layout of a page?

Hello, I am developing a widget that can show a page inside a container. There is the code for showing a page:   mx.ui.openForm( form, { domNode: container, context: mxContext, callback: function(){ ... } }); Currently inside Mendix Modeler these pages are using the "Sidebar_Left_FullHeight" layout and I am hiding the layout inside the widget content via CSS but that leads to "multiple define" errors in the browser console.   So my question is can the widget change the layout of the page before (or maybe after?) showing the page?          
1 answers

Hi Volen Todorov,

Within the Mendix model you have the ability to use layouts, pages and snippets to support flexibility, maintenance and reusing components. When the model is deployed to run as an application that structure of reusing is removed. Each page definition contains the code of the layouts, page and snippets in one set. The Mendix runtime optimizes the page switches to prevent complete rendering of each page.

So it become really difficult to almost impossible to remove the layout of a rendered page. The best is so duplicate a page in a normal layout (in content pages) and a popuplayout (widget use) and use snippets to define a page 1 time.

To have exact code example have a look at the Dataview Loader widget in the appstore or in Github