|
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.AbstractField
com.vaadin.ui.Button
org.grails.plugin.vaadin.ui.GrailsButton
@SuppressWarnings("unchecked") class GrailsButton extends Button
Mimics the g:link tag.
Note one key benefit of the Vaadin button is that you can pass the domain instance itself using the 'instance' parameter, instead of using a params map.
Field Summary | |
---|---|
protected Map |
args
Link specified as map - contains for example 'controller', 'action' etc. |
protected boolean |
rendered
Prevent rendering twice |
Fields inherited from class Button | |
---|---|
STYLE_LINK, UNITS_PIXELS, UNITS_POINTS, UNITS_PICAS, UNITS_EM, UNITS_EX, UNITS_MM, UNITS_CM, UNITS_INCH, UNITS_PERCENTAGE, SIZE_UNDEFINED, UNIT_SYMBOLS |
Fields inherited from class AbstractField | |
---|---|
UNITS_PIXELS, UNITS_POINTS, UNITS_PICAS, UNITS_EM, UNITS_EX, UNITS_MM, UNITS_CM, UNITS_INCH, UNITS_PERCENTAGE, SIZE_UNDEFINED, UNIT_SYMBOLS |
Property Summary | |
---|---|
String |
fragment
Specifies fragment we are linking to. |
Closure |
onclick
Specify a closure that mimics the javascript 'onclick'. |
Constructor Summary | |
GrailsButton()
Construct an empty button. |
|
GrailsButton(String caption, Object args)
Construct a button using the specified caption and 'request' args. |
|
GrailsButton(String caption, Object args, Closure onclick)
Construct a button using the specified caption, 'request' args and onclick closure. |
Method Summary | |
---|---|
void
|
attach()
Render when attached |
void
|
dispatch()
Dispatches the request to the specified controller/action/fragment, without executing the onclick method. |
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. |
Closure
|
getOnclick()
Get the onclick closure of the link. |
Map
|
getParams()
Get the params of the link. |
protected void
|
render()
Renders the gsp body. |
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
|
setOnclick(Closure onclick)
Set the onclick closure of the link. |
void
|
setParams(Map params)
Set the params of the link. |
Field Detail |
---|
protected Map args
protected boolean rendered
Property Detail |
---|
String fragment
Closure onclick
Constructor Detail |
---|
GrailsButton()
GrailsButton(String caption, Object args)
Note that the args can be a map containing 'controller', 'action' etc. or simply a URI fragment, e.g. "#/book/list"
See VaadinRequest for the valid list of args that can be used for a Vaadin 'request'.
caption
- The button caption to displayargs
- Either a map of args or a URI fragment string
GrailsButton(String caption, Object args, Closure onclick)
Note that the args can be a map containing 'controller', 'action' etc. or simply a URI fragment, e.g. "#/book/list"
See VaadinRequest for the valid list of args that can be used for a Vaadin 'request'.
caption
- The button caption to displayargs
- Either a map of args or a URI fragment string
Method Detail |
---|
void attach()
void dispatch()
If no controller/action/fragment is specified, then this silently does nothing.
Note that the button must be attached before this method is called.
String getAction()
Object getController()
String getId()
Object getInstance()
Closure getOnclick()
Map getParams()
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 setOnclick(Closure onclick)
void setParams(Map params)
Groovy Documentation