org.codehaus.groovy.grails.plugins.web.taglib
[Groovy] Class RenderTagLib
java.lang.Object
org.codehaus.groovy.grails.plugins.web.taglib.RenderTagLib
- All Implemented Interfaces:
- com.opensymphony.module.sitemesh.RequestConstants
@Artefact("TagLibrary")
class RenderTagLib
extends java.lang.Object
Tags to help rendering of views and layouts.
- Authors:
- Graeme Rocher
Method Summary |
protected java.lang.Object
|
getPage()
|
Methods inherited from class java.lang.Object
|
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
applyLayout
groovy.lang.Closure applyLayout
- Apply a layout to a particular block of text or to the given view or template.
<g:applyLayout name="myLayout">some text</g:applyLayout>
<g:applyLayout name="myLayout" template="mytemplate" />
<g:applyLayout name="myLayout" url="http://www.google.com" />
<g:applyLayout name="myLayout" action="myAction" controller="myController">
- attr:
- name The name of the layout
- attr:
- template Optional. The template to apply the layout to
- attr:
- url Optional. The URL to retrieve the content from and apply a layout to
- attr:
- action Optional. The action to be called to generate the content to apply the layout to
- attr:
- controller Optional. The controller that contains the action that will generate the content to apply the layout to
- attr:
- contentType Optional. The content type to use, default is "text/html"
- attr:
- encoding Optional. The encoding to use
- attr:
- params Optional. The params to pass onto the page object
- attr:
- parse Optional. If true, Sitemesh parser will always be used to parse the content.
errorsViewStackTracePrinter
ErrorsViewStackTracePrinter errorsViewStackTracePrinter
-
groovyPagesTemplateEngine
GroovyPagesTemplateEngine groovyPagesTemplateEngine
-
groovyPagesTemplateRenderer
GroovyPagesTemplateRenderer groovyPagesTemplateRenderer
-
ifPageProperty
groovy.lang.Closure ifPageProperty
- Invokes the body of this tag if the page property exists:
<g:ifPageProperty name="meta.index">body to invoke</g:ifPageProperty>
or it equals a certain value:
<g:ifPageProperty name="meta.index" equals="blah">body to invoke</g:ifPageProperty>- attr:
- name REQUIRED the property name
- attr:
- equals optional value to test against
include
groovy.lang.Closure include
- Includes another controller/action within the current response.
<g:include controller="foo" action="test"></g:include>
- emptyTag:
- @attr controller The name of the controller
- attr:
- action The name of the action
- attr:
- id The identifier
- attr:
- params Any parameters
- attr:
- view The name of the view. Cannot be specified in combination with controller/action/id
- attr:
- model A model to pass onto the included controller in the request
layoutBody
groovy.lang.Closure layoutBody
- Used in layouts to render the body of a SiteMesh layout.
<g:layoutBody />- emptyTag:
layoutHead
groovy.lang.Closure layoutHead
- Used in layouts to render the head of a SiteMesh layout.
<g:layoutHead />- emptyTag:
layoutTitle
groovy.lang.Closure layoutTitle
- Used in layouts to render the page title from the SiteMesh page.
<g:layoutTitle default="The Default title" />- emptyTag:
- @attr default the value to use if the title isn't specified in the GSP
pageProperty
groovy.lang.Closure pageProperty
- Used to retrieve a property of the decorated page.
<g:pageProperty default="defaultValue" name="body.onload" />
- emptyTag:
- @attr REQUIRED name the property name
- attr:
- default the default value to use if the property is null
- attr:
- writeEntireProperty if true, writes the property in the form 'foo = "bar"', otherwise renders 'bar'
paginate
groovy.lang.Closure paginate
- Creates next/previous links to support pagination for the current controller.
<g:paginate total="${Account.count()}" />
- emptyTag:
- @attr total REQUIRED The total number of results to paginate
- attr:
- action the name of the action to use in the link, if not specified the default action will be linked
- attr:
- controller the name of the controller to use in the link, if not specified the current controller will be linked
- attr:
- id The id to use in the link
- attr:
- params A map containing request parameters
- attr:
- prev The text to display for the previous link (defaults to "Previous" as defined by default.paginate.prev property in I18n messages.properties)
- attr:
- next The text to display for the next link (defaults to "Next" as defined by default.paginate.next property in I18n messages.properties)
- attr:
- omitPrev Whether to not show the previous link (if set to true, the previous link will not be shown)
- attr:
- omitNext Whether to not show the next link (if set to true, the next link will not be shown)
- attr:
- omitFirst Whether to not show the first link (if set to true, the first link will not be shown)
- attr:
- omitLast Whether to not show the last link (if set to true, the last link will not be shown)
- attr:
- max The number of records displayed per page (defaults to 10). Used ONLY if params.max is empty
- attr:
- maxsteps The number of steps displayed for pagination (defaults to 10). Used ONLY if params.maxsteps is empty
- attr:
- offset Used only if params.offset is empty
- attr:
- mapping The named URL mapping to use to rewrite the link
- attr:
- fragment The link fragment (often called anchor tag) to use
render
groovy.lang.Closure render
- Renders a template inside views for collections, models and beans. Examples:
<g:render template="atemplate" collection="${users}" />
<g:render template="atemplate" model="[user:user,company:company]" />
<g:render template="atemplate" bean="${user}" />
- attr:
- template REQUIRED The name of the template to apply
- attr:
- contextPath the context path to use (relative to the application context path). Defaults to "" or path to the plugin for a plugin view or template.
- attr:
- bean The bean to apply the template against
- attr:
- model The model to apply the template against as a java.util.Map
- attr:
- collection A collection of model objects to apply the template to
- attr:
- var The variable name of the bean to be referenced in the template
- attr:
- plugin The plugin to look for the template in
renderException
java.lang.Object renderException
- Renders an exception for the errors view
- attr:
- exception REQUIRED The exception to render
sortableColumn
groovy.lang.Closure sortableColumn
- Renders a sortable column to support sorting in list views.
Attribute title or titleKey is required. When both attributes are specified then titleKey takes precedence,
resulting in the title caption to be resolved against the message source. In case when the message could
not be resolved, the title will be used as title caption.
Examples:
<g:sortableColumn property="title" title="Title" />
<g:sortableColumn property="title" title="Title" style="width: 200px" />
<g:sortableColumn property="title" titleKey="book.title" />
<g:sortableColumn property="releaseDate" defaultOrder="desc" title="Release Date" />
<g:sortableColumn property="releaseDate" defaultOrder="desc" title="Release Date" titleKey="book.releaseDate" />
- emptyTag:
- @attr property - name of the property relating to the field
- attr:
- defaultOrder default order for the property; choose between asc (default if not provided) and desc
- attr:
- title title caption for the column
- attr:
- titleKey title key to use for the column, resolved against the message source
- attr:
- params a map containing request parameters
- attr:
- action the name of the action to use in the link, if not specified the list action will be linked
- attr:
- params A map containing URL query parameters
- attr:
- class CSS class name
getPage
protected java.lang.Object getPage()
-
Groovy Documentation