Wicket Plugin

Wicket Plugin

This plugin is outdated for Grails 1.1. check: http://www.nabble.com/Wicket-plugin-and-Grails-1.1-td22720662.html

In addition, since Groovy doesn't support anonymous inner classes and nested classes this makes using the Wicket API a little tedious without a builder.

Support will be added for Groovy 1.7 at which point this plugin will be updated for 1.1 support

If you want to use the Wicket framework as an alternative view rendering technology ontop of GORM then this plug-in is for you

Features

The plug-in provides the following features:

  1. Hot reloading of the WicketApplication class
  2. Hot reloading of Wicket Pages and views
  3. Integration with GORM and the underlying Spring container

Installing the Plug-in

The plug-in is available from the Grails central repository and can be installed with:

grails install-plugin wicket
The installation process will create a class called WicketApplication at the location grails-app/conf/WicketApplication.groovy

Pages and Views

The plug-in provides a new directory under grails-app/pages where you should create your Wicket page classes which should end in the convention "Page" if you want hot reloading to happen. For example:

import org.apache.wicket.markup.html.WebPage
import org.apache.wicket.markup.html.basic.Label
import org.apache.wicket.PageParameters

public class HelloPage extends WebPage { public HelloPage(final PageParameters parameters) { add(new Label("message", "If you see this message wicket is properly configured and running!")); } }

Now define the view in grails-app/views:
<html>
<body>
    <span wicket:id="message">Message goes here</span>
</body>
</html>

Running the Application

Start-up your app with grails run-app then access http://localhost:8080/wicket-example/app

2 Comments

  • Gravatar
    Are there any plans on updating this plugin so it works with more recent versions? If not can the source be downloaded somewhere?
    Mar 30, 2009 09:03 AM btilford
  • Gravatar
    The source is available at https://svn.codehaus.org/grails-plugins/grails-wicket/

    Patches welcome

    May 07, 2009 10:05 AM graemerocher

Post a Comment