[View] [Edit] [Lock] [References] [Attachments] [History] [Home] [Changes] [Search] [Help]
example[spec] Add a widget
" add a new text widget at the bottom of the rendered UI "
" self is a coordinator "
| jsObject js widgets newSpec |
jsObject := self template basicAt: #spec.
js := JS @ jsObject.
widgets := JS @ (js @ #configuration) @ #widgets.
" define the spec for the new widget "
newSpec := (#class -> #MobileText ),
(#configuration -> ( (#order -> 6),(#text -> 'test text!') )).
JS @ widgets handleAt: #newText put: newSpec json.
self thread update