|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectcom.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractComponentContainer
com.vaadin.ui.AbstractLayout
com.vaadin.ui.CustomLayout
org.grails.plugin.vaadin.ui.GspTemplateLayout
class GspTemplateLayout extends CustomLayout
A Vaadin CustomLayout that contains a single org.grails.plugin.vaadin.ui.GrailsLayout.
The contained org.grails.plugin.vaadin.ui.GrailsLayout is built using the specified layout template.
A key benefit of this class is it allows changing the Gsp after the page has been built and rendered. This is achieved by replacing the contained org.grails.plugin.vaadin.ui.GrailsLayout with a new one.
Field Summary | |
---|---|
protected boolean |
rendered
Prevent rendering twice |
Property Summary | |
---|---|
GspLayout |
gspLayout
The contained layout |
String |
name
The layout name or URI of the Gsp to use as layout. |
Constructor Summary | |
GspTemplateLayout()
Empty constructor |
Method Summary | |
---|---|
void
|
attach()
Render when attached |
protected void
|
render()
Constructs the gsp |
void
|
requestRender(boolean force = false)
Requests the render to take place if not yet done. |
protected def
|
requireVaadinApplication()
Helper method for situations where a Vaadin Application is required |
void
|
setBody(Closure body)
Sets the body of the gsp layout tag |
void
|
setContext(Map gsp)
Sets the context of the Gsp template. |
protected String
|
toLayoutName(String name)
Converts the layout name to the URI of the Gsp. |
void
|
update()
Renders the Gsp corresponding to the configured layout name or URI, and replaces the existing Gsp in this container with the result. |
void
|
update(String name)
Changes the template used for rendering the Gsp. |
void
|
update(Map args)
Changes the template used for rendering the Gsp. |
Field Detail |
---|
protected boolean rendered
Property Detail |
---|
GspLayout gspLayout
String name
If starts with '/' then is resolved relative to 'views' dir. Otherwise, is resolved relative to 'views/vaadin/layouts'
Constructor Detail |
---|
GspTemplateLayout()
Method Detail |
---|
void attach()
protected void render()
void requestRender(boolean force = false)
Note that rendering should only be done after the component has been attached, as the Vaadin application is required.
force
- Force the render, even if already done
protected def requireVaadinApplication()
void setBody(Closure body)
body
- The tag body
void setContext(Map gsp)
gsp
- The gsp context args, which are listed below.uri
- The uri of the GSP view, template or resource.params
- The params map to use when rendering the GSP.model
- The model map to use when rendering the GSP.flash
- The flash scope object to use when rendering the GSP.controllerName
- The controller name to use when rendering the GSP.
protected String toLayoutName(String name)
If starts with '/' then is resolved relative to 'views' dir. Otherwise, is resolved relative to 'views/layouts'
void update()
Should only be called after this component is attached.
void update(String name)
Should only be called after this component is attached.
name
- The layout name or URI of the Gsp to use as layout.
void update(Map args)
Should only be called after this component is attached.
name
- The layout name or URI of the Gsp to use as layout.
Groovy Documentation