Groovy Documentation

org.grails.plugin.vaadin.ui
[Groovy] Class GrailsIncludeLayout

java.lang.Object
  com.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.

Authors:
Francis McKenzie


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()

 
Methods inherited from class CustomLayout
getComponent, getComponentCount, setMargin, setMargin, addComponent, addComponent, setStyle, removeComponent, removeComponent, getComponentIterator, paintContent, replaceComponent, getTemplateName, getTemplateContents, setTemplateName, setTemplateContents, setMargin, getMargin, changeVariables, setEnabled, setWidth, addListener, addListener, attach, removeListener, removeListener, removeAllComponents, requestRepaintAll, moveComponentsFrom, detach, setHeight, getParent, setReadOnly, isReadOnly, setParent, getData, setLocale, getDescription, paint, getListeners, isVisible, isEnabled, setVisible, getLocale, getWidth, getHeight, setIcon, getIcon, setWidth, setWidth, setDescription, getErrorMessage, setErrorHandler, getErrorHandler, addListener, addListener, addListener, addListener, getStyle, setData, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, getStyleName, setStyleName, addStyleName, removeStyleName, getCaption, setCaption, getWindow, getApplication, childRequestedRepaint, setDebugId, getDebugId, requestRepaintRequests, isImmediate, setHeight, setHeight, getWidthUnits, setWidthUnits, getHeightUnits, setHeightUnits, setSizeFull, setSizeUndefined, setImmediate, getComponentError, setComponentError, handleError, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 
Methods inherited from class AbstractLayout
setMargin, setMargin, setMargin, getMargin, paintContent, changeVariables, setEnabled, setWidth, addComponent, addListener, addListener, attach, removeListener, removeListener, removeComponent, removeAllComponents, requestRepaintAll, moveComponentsFrom, detach, setHeight, getParent, setReadOnly, isReadOnly, setParent, getData, setLocale, getDescription, paint, getListeners, isVisible, isEnabled, setVisible, getLocale, getWidth, getHeight, setIcon, getIcon, setWidth, setWidth, setDescription, getErrorMessage, setErrorHandler, getErrorHandler, addListener, addListener, addListener, addListener, getStyle, setStyle, setData, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, getStyleName, setStyleName, addStyleName, removeStyleName, getCaption, setCaption, getWindow, getApplication, childRequestedRepaint, setDebugId, getDebugId, requestRepaintRequests, isImmediate, setHeight, setHeight, getWidthUnits, setWidthUnits, getHeightUnits, setHeightUnits, setSizeFull, setSizeUndefined, setImmediate, getComponentError, setComponentError, handleError, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll, getComponentIterator, replaceComponent
 

Field Detail

args

protected Map args
Link specified as map - contains for example 'controller', 'action' etc.


rendered

protected boolean rendered
Prevent rendering twice


view

protected Component view
The contained view


 
Property Detail

fragment

String fragment
Specifies fragment we are linking to. Ignored if we specify other parameters such as 'controller' or 'action'


 
Constructor Detail

GrailsIncludeLayout

GrailsIncludeLayout()
Empty constructor


GrailsIncludeLayout

GrailsIncludeLayout(String fragment)
Creates a new instance by executing the specified fragment request.
Parameters:
fragment - The fragment to request, for example "book/list"


 
Method Detail

addViewComponent

protected void addViewComponent(Component view)
Adds the specified view to this container.


attach

void attach()
Render when attached


getAction

String getAction()
Get the action of the link.


getController

Object getController()
Get the controller of the link - either a logical property name, or the class itself.


getId

String getId()
Get the domain class id of the link.


getInstance

Object getInstance()
Get the domain class instance of the link.


getParams

Map getParams()
Get the params of the link.


include

void include()
Submits a new request using the controller, action etc if specified, otherwise the fragment.

Replaces the existing Gsp in this container with the result.


include

void include(String fragment)
Submits a new request using the specified fragment, and replaces the existing Gsp in this container with the result.
Parameters:
fragment - The fragment for the request, for example "book/list"


include

void include(Map args)
Submits a new request using the specified args, and replaces the existing Gsp in this container with the result.
Parameters:
args - The args containing the request details, for example 'controller', 'action' etc.


render

protected void render()
Dispatches the include request, or renders an empty view if no request specified.


requestRender

void requestRender(boolean force = false)
Requests the render to take place if not yet done.

Note that rendering should only be done after the component has been attached, as the Vaadin application is required.

Parameters:
force - Force the render, even if already done


requireVaadinApplication

protected def requireVaadinApplication()
Helper method for situations where a Vaadin Application is required


requireVaadinTransactionManager

protected def requireVaadinTransactionManager()
Helper method for situations where a Vaadin Transaction Manager is required


setAction

void setAction(Object action)
Set the action of the link.


setController

void setController(Object controller)
Set the controller of the link - either a logical property name, or the class itself.


setId

void setId(Object id)
Set the domain class id of the link.


setInstance

void setInstance(Object instance)
Set the domain class instance of the link.


setParams

void setParams(Map params)
Set the params of the link.


toString

String toString()


 

Groovy Documentation