(Quick Reference)
layout
Purpose
Renders the tag's body using another Gsp as a template.
Examples
Take a GSP layout template called
/grails-app/views/vaadin/layouts/greetinglayout.gsp
with the following content:
<h1>Greeting<h1>
<div location="mygreeting"></div>
This could then be applied as a layout template for another GSP, like so:
<v:layout name="greetinglayout">
<v:location name="mygreeting">
<div>Hello World!</div>
</v:location>
</v:label>
The resulting HTML would (effectively) be:
<h1>Greeting<h1>
<div location="mygreeting"><div>Hello World!</div></div>
This is an indication of the type of HTML that would be created, but it is not
exact as Vaadin has its own rules for rendering CustomLayout components.
Description
This tag facilitates using another GSP as a layout template for the current GSP. It is similar
to the
Sitemesh layout functionality.
The GSP used as the layout template should contain HTML tags with a 'location' attribute. The name
specified by this 'location' attribute is then referenced by the <v:location> tag in the current GSP.
Body
- Should contain <v:location> tags OR a list of Vaadin tags each with a 'location' attribute set.
Attributes
Specific
name
(required) The name of the GSP layout template. Either an absolute path, or else relative to directory grails-app/views/vaadin/layouts
General
var
(optional) Uses Grails's set tag to set the value of the specified variable to be this component.
class
(optional) The CSS class name to add to the component using the addStyleName() method
sizeUndefined
(optional) Calls setSizeUndefined() on the component. (Attribute value is ignored)
sizeFull
(optional) Calls setSizeFull() on the component. (Attribute value is ignored)
location
(optional) The location slot in the parent container to which this component should be added.
wrapperClass
, wrapperStyle
(optional) Special styling for wrapper <div>
.
See Vaadin CustomLayout API docs for full list of allowed attributes.