Quantcast

using taglib function inside a custom taglib

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

using taglib function inside a custom taglib

andre.prasetya@gmail.com
Hi,

I am using the remotePaginate tags from contribute a tag page, I saw
that the taglib is tightly coupled with prototype. I was thinking of
making it more generic, and grails already provided remoteFunction, but
is it possible to use another taglib inside our custom one ? and is
there any example ?

-andre-

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: using taglib function inside a custom taglib

mos-7
Cause you can use every taglib as a usual method-call you can reuse existing taglibs inside you custom ones.
For example similar like this:
 
def myCustomTagMessage = {  attrs ->
    String defaultMessage = g.message(attrs)            // reuse
    out << "</h1>${defaultMessage} </h1>"
}
 
 

Cheers,
mos


On Sat, Jan 17, 2009 at 6:59 AM, Andre Prasetya <[hidden email]> wrote:
Hi,

I am using the remotePaginate tags from contribute a tag page, I saw that the taglib is tightly coupled with prototype. I was thinking of making it more generic, and grails already provided remoteFunction, but is it possible to use another taglib inside our custom one ? and is there any example ?

-andre-

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: using taglib function inside a custom taglib

Tom Nichols
Hi mos,

Is this documented in the reference documentation anywhere?  I have to
say this is a very useful feature for 'extending' grails or plugin
tags.  However I couldn't figure out exactly how this works.  I assume
it also works between two different user taglibs in the same project
if they are in different namespaces?

Thanks.  This is a very handy tip to have.

-Tom


On Sat, Jan 17, 2009 at 4:21 AM, mos <[hidden email]> wrote:

> Cause you can use every taglib as a usual method-call you can reuse existing
> taglibs inside you custom ones.
> For example similar like this:
>
> def myCustomTagMessage = {  attrs ->
>     String defaultMessage = g.message(attrs)            // reuse
>     out << "</h1>${defaultMessage} </h1>"
> }
>
>
> Cheers,
> mos
>
>
> On Sat, Jan 17, 2009 at 6:59 AM, Andre Prasetya <[hidden email]>
> wrote:
>>
>> Hi,
>>
>> I am using the remotePaginate tags from contribute a tag page, I saw that
>> the taglib is tightly coupled with prototype. I was thinking of making it
>> more generic, and grails already provided remoteFunction, but is it possible
>> to use another taglib inside our custom one ? and is there any example ?
>>
>> -andre-
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>   http://xircles.codehaus.org/manage_email
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: using taglib function inside a custom taglib

boaefung12
This post has NOT been accepted by the mailing list yet.
In reply to this post by andre.prasetya@gmail.com
I saw lots of example from this site:
http://adf.ly/Bjaru 
It's basically a closure in this format:
g.action([comma separated attributes])

For example:
g.sortableColumn([property:'propertyName', title:'Title Here'])
g.formatDate([date: date, type:'datetime', style: 'MEDIUM'])

I wish there were more documentation about this.
Loading...