Measurable Success «10 Checkpoints for Future-Proof Enterprise CMS» White Paper
Measurable Success - White Paper

new Widget(attributes)

Creates a Widget instance.

The new widget must be stored inside a container (i.e. in an Obj or another Widget) before it can be used.

A widget can be stored inside a container by adding it to a widgetlist attribute using Obj#update or Widget#update.


  • attributes (Object) - The attributes of the new widget. The _objClass must be provided.


Creating a Page Obj object and a widget and placing the latter into the body widgetlist of the page.

page = Scrivito.getClass("Page").create({});
widget = new (Scrivito.getClass("TextWidget"))({text: 'Hello World'});
page.update({body: [widget]});