Hi all,

Today I played a bit with Groovy which promises seamless integration with Java code. Thus one can use a dynamic language together with a Java framework such as Click.

From the little testing I did it seems possible to author Click pages using Groovy. Below is my GroovyPage.groovy class:


class GroovyPage extends Page {

  onInit() {
      def form = new Form("form");
      form.add(new TextField("field");
      addControl(form);

      def label = new Label("label");

      // Note usage of multiline string below
      label.setLabel("""
          Hello
          <br>
          World!""");

      addControl(label);
  }
}

One thing which is not yet supported in Groovy is anonymous inner classes. But the rest should work fine. ;-)

bob

Reply via email to