|
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.GrailsIncludeLayout
class GrailsIncludeLayout extends CustomLayout
A Vaadin CustomLayout that contains a single view Component resulting from a grails request.
The contained view Component is built by executing a request for the specified controller, action, etc.
A key benefit of this class is it allows changing the view after the page has been built and rendered. This is achieved by replacing the contained Component with a new one.
Field Summary | |
---|---|
protected Map |
args
Link specified as map - contains for example 'controller', 'action' etc. |
protected boolean |
rendered
Prevent rendering twice |
protected Component |
view
The contained view |
Property Summary | |
---|---|
String |
fragment
Specifies fragment we are linking to. |
Constructor Summary | |
GrailsIncludeLayout()
Empty constructor |
|
GrailsIncludeLayout(String fragment)
Creates a new instance by executing the specified fragment request. |
Method Summary | |
---|---|
protected void
|
addViewComponent(Component view)
Adds the specified view to this container. |
void
|
attach()
Render when attached |
String
|
getAction()
Get the action of the link. |
Object
|
getController()
Get the controller of the link - either a logical property name, or the class itself. |
String
|
getId()
Get the domain class id of the link. |
Object
|
getInstance()
Get the domain class instance of the link. |
Map
|
getParams()
Get the params of the link. |
void
|
include()
Submits a new request using the controller, action etc if specified, otherwise the fragment. |
void
|
include(String fragment)
Submits a new request using the specified fragment, and replaces the existing Gsp in this container with the result. |
void
|
include(Map args)
Submits a new request using the specified args, and replaces the existing Gsp in this container with the result. |
protected void
|
render()
Dispatches the include request, or renders an empty view if no request specified. |
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 |
protected def
|
requireVaadinTransactionManager()
Helper method for situations where a Vaadin Transaction Manager is required |
void
|
setAction(Object action)
Set the action of the link. |
void
|
setController(Object controller)
Set the controller of the link - either a logical property name, or the class itself. |
void
|
setId(Object id)
Set the domain class id of the link. |
void
|
setInstance(Object instance)
Set the domain class instance of the link. |
void
|
setParams(Map params)
Set the params of the link. |
String
|
toString()
|
Field Detail |
---|
protected Map args
protected boolean rendered
protected Component view
Property Detail |
---|
String fragment
Constructor Detail |
---|
GrailsIncludeLayout()
GrailsIncludeLayout(String fragment)
fragment
- The fragment to request, for example "book/list"
Method Detail |
---|
protected void addViewComponent(Component view)
void attach()
String getAction()
Object getController()
String getId()
Object getInstance()
Map getParams()
void include()
Replaces the existing Gsp in this container with the result.
void include(String fragment)
fragment
- The fragment for the request, for example "book/list"
void include(Map args)
args
- The args containing the request details, for example
'controller', 'action' etc.
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()
protected def requireVaadinTransactionManager()
void setAction(Object action)
void setController(Object controller)
void setId(Object id)
void setInstance(Object instance)
void setParams(Map params)
String toString()
Groovy Documentation