Anonymous inner classes are nice for their brevity but they are not
required. You can declare those as concrete classes. I'm not too sure
about Groovy but you should be able to put them in the same file.

-----Original Message-----
From: JulianS [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 22, 2008 4:36 PM
To: [email protected]
Subject: Re: New Wicket Grails Plug-in Available + about the Groovy
wicket builder


I just tried this plugin for the first time and I got the example to
run. But
as soon as I tried to do something as simple as loop through a list of
items, it all came unstuck (code below). It seems to me like the
mismatch
between Wicket's use of anonymous inner classes and Groovy's lack of
support
for them is a deal breaker. You either have to reduce your usage of
Wicket
in Groovy code to preexisting Wicket components that were built in Java
(like the Label below), or you have to use a Groovy builder that emits
Java
code, which then gets compiled. Am I missing something? I hope so, I'd
love
to use GORM and Wicket together.

HomePage.groovy:

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!"));
                add(new Loop("repeat", Book.list( 10 )))
                {
                        @Override
                        protected void populateItem(LoopItem item)
                        {
                                Book book = (Book)
item.getModelObject();
                                item.setModel(new
CompoundPropertyModel(book));
                                item.add(new Label("name"));
                        }
                }
        }
}

Julian

-- 
View this message in context:
http://www.nabble.com/New-Wicket-Grails-Plug-in-Available-%2B-about-the-
Groovy-wicket-builder-tp15828796p18598173.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

_____________

The information contained in this message is proprietary and/or confidential. 
If you are not the 
intended recipient, please: (i) delete the message and all copies; (ii) do not 
disclose, 
distribute or use the message in any manner; and (iii) notify the sender 
immediately. In addition, 
please be aware that any message addressed to our domain is subject to 
archiving and review by 
persons other than the intended recipient. Thank you.
_____________

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to