agileaholic :)

Java, groovy, grails, hacking and more…

Archive for the ‘grails’ Category

The grails framework using groovy

Modal Box Plugin for Grails

Posted by Prabhu Beeman on July 6, 2008

[Update: This issue is now fixed in the latest version of the plugin. Thanks for the fix Alex.]
Plugin url: http://www.grails.org/ModalBox+Plugin

I tried to implement the Modal Box Plugin in my application and had difficulties in getting it done.The instruction given in the above site looked straight forward. But then after following the instruction all I get is a blank page..

looked into the generated html (right click and view source)

following was the header snippet (<modalbox:modalIncludes/> generates the following code)

<script type=’text/javascript’ src=’/myapp/plugins/modalbox-0.1/js/modalbox/prototype.js’ />
<script type=’text/javascript’ src=’/myapp/plugins/modalbox-0.1/js/modalbox/scriptaculous.js?load=effects’ />
<script type=’text/javascript’ src=’/myapp/plugins/modalbox-0.1/js/modalbox/modalbox.js’ />
<link rel=’stylesheet’ href=’/myapp/plugins/modalbox-0.1/css/modalbox.css’ />

Effectively removing the <modalbox:modalIncludes/> from the jsp gsp renders the page correctly
So time to scrutinize the above 4 lines..
The problem was actually with the empty close tag.

So ideally
<script type=’text/javascript’ src=’/myapp/plugins/modalbox-0.1/js/modalbox/prototype.js’ />

should be

<script type=’text/javascript’ src=’/myapp/plugins/modalbox-0.1/js/modalbox/prototype.js’ ></script>
and so is the rest.
bingo.. everything works great now.

So how do i make this change in the plugin?

Go to your plugins directory -> modalbox-0.1->grails-app->taglib->ModalboxTaglib

then make your changes inside def modalIncludes

Its done…I’m a happy soul now :-)

Posted in grails, plugin | 1 Comment »