7.2.6 Root - Reference Documentation
Authors: Andres Almiray
Version: 1.2.0
7.2.6 Root
Provided by: GriffonIdentifies the top level node of a secondary View script. View scripts are expected to return the top level node, however there may be times when further customizations prevent this from happening, for example wiring up a custom listener. When that happens the result has to be made explicit otherwise the script will return the wrong value. Using theroot()
node avoids forgetting this fact while also providing an alias for the node.Secondary view script named "SampleSecondary"
root(
tree(id: 'mytree')
)mytree.addTreeSelectionModel(new DefaultTreeSelectionModel() {
…
})
build(SampleSecondary) application(title: 'Sample') { borderLayout() label 'Options', constraints: NORTH widget root(SampleSecondary) }
name
that can be used to override the default alias assigned to the node. If you specify a value for this parameter when the node is built then you'll need to use it again to retrieve the node.