I've created some GUI parts with GUI Builder and I wanted to embed them in panels of my scripts, instead of adding them directly in the app.
But apparently, a such code doesn't work:
var app = UiApp.createApplication();
var vp = app.createVerticalPanel();
vp.add(app.loadComponent("myGUI"));
app.add(vp);
return app;
Is it (or will it be) possible to add GUI's from GUI Builder in other containers than app?
Thanks!
You can do it like in this example
function doGet() {
var app = UiApp.createApplication()
var Panel = app.createAbsolutePanel().setStyleAttribute('background', 'beige').setPixelSize(400,600);
var label = app.createLabel('gui test')
var gui = app.loadComponent('MyGui')
Panel.add(app.getElementById('VerticalPanel1'))
Panel.add(label)
app.add(Panel)
return app
}
and the GUI looks like this :
Instead of adding the component I added the panel (in this example 'VerticalPanel1') that contains all the other widgets.
The result looks like this :