Groovy
  1. Groovy
  2. GROOVY-1239

Builders: calls to owner methods from within nested closures lead to markup instead of method calling

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-4
    • Fix Version/s: 1.0-JSR-5
    • Component/s: None
    • Labels:
      None

      Description

      This seems similar to a problem I experience with SwingBuilder.. where
      a change made it impossible to call methods from inside the builder.
      To fix it i had to do something like:

      def self = this

      swing {
      button(action:

      { self.someMethod() }

      )
      }

      void someMethod() {
      // the method
      }

      Note the above is just psuedo code from memory but the problems seem similar

      Graeme

      On 11/02/06, Dierk Koenig <dierk.koenig@canoo.com> wrote:
      > Hi,
      >
      > the following Groovlet runs fine
      > ----
      > html.html{
      > head

      { > title 'Groovlet Demonstrator' > }
      > content()
      > }
      > void content() { > html.body 'Welcome' > }
      > ----
      >
      > This fails:
      > ----
      > html.html{
      > head {> title 'Groovlet Demonstrator'> }

      > p

      { content() }

      // <- mind the p{}
      > }
      >
      > void content()

      { > html.body 'Welcome' > }

      > ----
      >
      > It produces:
      > ----
      > <html>
      > <head>
      > <title>Groovlet Demonstrator</title>
      > </head>
      > <p>
      > <content />
      > </p>
      > </html>
      > ----
      >
      > Logs are empty.
      >
      > Has anybody an idea? Has it anything to do with the latest
      > changes to Closures?
      >
      > cheers
      > Mittie
      >

        Activity

          People

          • Assignee:
            John Wilson
            Reporter:
            Dierk König
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development