<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	>
<channel>
	<title>Comments on: Okay, Grails, That Was Cute: Taglibs</title>
	<atom:link href="http://enfranchisedmind.com/blog/posts/grails-taglibs/feed/" rel="self" type="application/rss+xml" />
	<link>http://enfranchisedmind.com/blog/posts/grails-taglibs/</link>
	<description>programming, politics, &#38; other religious issues</description>
	<lastBuildDate>Mon, 15 Mar 2010 00:31:40 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: karthik</title>
		<link>http://enfranchisedmind.com/blog/posts/grails-taglibs/#comment-33239</link>
		<dc:creator>karthik</dc:creator>
		<pubDate>Fri, 16 May 2008 00:52:26 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/?p=637#comment-33239</guid>
		<description>I hated tag libs too and i stayed away from JSP / java web development tier in general for a few years  - i just found the tag lib reuse (&amp; programming) model irritating

and then i found Apache Wicket!

So what you do is write a component that extends from the framework supplied Link class -

 class DobLink extends Link{
   
     DobLink(String id,List dobs){
       super(id, new Model(dobs));
     }
     
     @Override
     public boolean isVisible(){
       List dobs = model.getModelObject();
       return !dobs.isEmpty();
     }         
   
     @Override
     public void onClick(){
   	setResonsePage(new DobPage());  
     }
     
   }

In the HTML template - (wicket works with plain HTML templates)

 &lt;a href=&quot;&quot; rel=&quot;nofollow&quot;&gt;Other Date(s) of Birth&lt;/a&gt;

and on the server-side page class - 

 add(new DobLink(&quot;dob&quot;, dobList ));

Now the link visibility will toggle based on the dobList size. 
I would strongly recommend Wicket for all tag lib haters.

There is a grails-wicket plugin apparently. Need to take a look!</description>
		<content:encoded><![CDATA[<p>I hated tag libs too and i stayed away from JSP / java web development tier in general for a few years  &#8211; i just found the tag lib reuse (&amp; programming) model irritating</p>
<p>and then i found Apache Wicket!</p>
<p>So what you do is write a component that extends from the framework supplied Link class -</p>
<p> class DobLink extends Link{</p>
<p>     DobLink(String id,List dobs){<br />
       super(id, new Model(dobs));<br />
     }</p>
<p>     @Override<br />
     public boolean isVisible(){<br />
       List dobs = model.getModelObject();<br />
       return !dobs.isEmpty();<br />
     }         </p>
<p>     @Override<br />
     public void onClick(){<br />
   	setResonsePage(new DobPage());<br />
     }</p>
<p>   }</p>
<p>In the HTML template &#8211; (wicket works with plain HTML templates)</p>
<p> <a href="" rel="nofollow">Other Date(s) of Birth</a></p>
<p>and on the server-side page class &#8211; </p>
<p> add(new DobLink(&#8220;dob&#8221;, dobList ));</p>
<p>Now the link visibility will toggle based on the dobList size.<br />
I would strongly recommend Wicket for all tag lib haters.</p>
<p>There is a grails-wicket plugin apparently. Need to take a look!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ryan</title>
		<link>http://enfranchisedmind.com/blog/posts/grails-taglibs/#comment-33236</link>
		<dc:creator>ryan</dc:creator>
		<pubDate>Thu, 15 May 2008 19:28:36 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/?p=637#comment-33236</guid>
		<description>Those taglibs are one of the reasons I&#039;m so excited about grails, (also one of the reason my co-workers are ready to throw me out since I got so giddy about it, an they&#039;re still using traditional Java on their project.)

I created one, (clearly for us in the states) for a state drop down list that also allows a passed in default choice for state if one had been selected previously and is in session or otherwise.

Our project doesn&#039;t have a States table to pull from and it was getting to be a pain typing it again and again.  We then tried including the list but it was difficult to pull off if someone was using different names for the already selected state, etc.  A custom tag was the answer!  Went from all those lines of code down to one line in the GSP.</description>
		<content:encoded><![CDATA[<p>Those taglibs are one of the reasons I&#8217;m so excited about grails, (also one of the reason my co-workers are ready to throw me out since I got so giddy about it, an they&#8217;re still using traditional Java on their project.)</p>
<p>I created one, (clearly for us in the states) for a state drop down list that also allows a passed in default choice for state if one had been selected previously and is in session or otherwise.</p>
<p>Our project doesn&#8217;t have a States table to pull from and it was getting to be a pain typing it again and again.  We then tried including the list but it was difficult to pull off if someone was using different names for the already selected state, etc.  A custom tag was the answer!  Went from all those lines of code down to one line in the GSP.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Fischer</title>
		<link>http://enfranchisedmind.com/blog/posts/grails-taglibs/#comment-33231</link>
		<dc:creator>Robert Fischer</dc:creator>
		<pubDate>Wed, 14 May 2008 22:32:20 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/?p=637#comment-33231</guid>
		<description>Not a bad plan, Mike.

Missed you at GUM, BTW.</description>
		<content:encoded><![CDATA[<p>Not a bad plan, Mike.</p>
<p>Missed you at GUM, BTW.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://enfranchisedmind.com/blog/posts/grails-taglibs/#comment-33230</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 14 May 2008 21:25:04 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/?p=637#comment-33230</guid>
		<description>Another cool trick I recently discovered was setting a namespace in the tag lib:

static namespace = &quot;data&quot;

let&#039;s you prefix your taglib with &#039;data:&#039; rather than &#039;g:&#039;

&lt;data:moreData ...

Once you have a bunch of tag lib classes, it makes it a little easier to know which *TagLib.groovy class to look in to find the implementation.</description>
		<content:encoded><![CDATA[<p>Another cool trick I recently discovered was setting a namespace in the tag lib:</p>
<p>static namespace = &#8220;data&#8221;</p>
<p>let&#8217;s you prefix your taglib with &#8216;data:&#8217; rather than &#8216;g:&#8217;</p>
<p>&lt;data:moreData &#8230;</p>
<p>Once you have a bunch of tag lib classes, it makes it a little easier to know which *TagLib.groovy class to look in to find the implementation.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
