You can create your own TagLib
and call remoteLink
with your onLoading
by default.
class AjaxTagLib {
static namespace = "my" //define a namespace to not conflict with g
def remoteLink = { attrs ->
//default onLoading attribute
if(!attrs.onLoading) {
attrs.onLoading = "blockUi()"
}
g.remoteLink(attrs)
}
}
Then you can use that instad of g.remoteLink
:
<my:remoteLink action="show" id="1" update="success">Show Book 1</my:remoteLink>