Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1713

A property expression that generates a list can not reference public static field

    XMLWordPrintableJSON

Details

    Description

      So in my template,

      context="[ foo, bar ]"

      And in my code:

      public static Foo FOO = Foo.FOO; // Foo is an enum type

      This fails:

      java.lang.IncompatibleClassChangeError

      Expected non-static field com.example.pages.MyPage.FOO

      • org.apache.tapestry5.internal.bindings.PropBinding.get(PropBinding.java:59)
      • org.apache.tapestry5.internal.transform.ParameterWorker$3$1.readFromBinding(ParameterWorker.java:254)
      • org.apache.tapestry5.internal.transform.ParameterWorker$3$1.get(ParameterWorker.java:372)
      • com.fivoosh.components.SilkPageLink.getfieldvalue_context(SilkPageLink.java)
      • com.fivoosh.components.SilkPageLink.getContext(SilkPageLink.java)
      • org.apache.tapestry5.internal.bindings.PropBinding.get(PropBinding.java:59)
      • org.apache.tapestry5.internal.transform.ParameterWorker$3$1.readFromBinding(ParameterWorker.java:254)
      • org.apache.tapestry5.internal.transform.ParameterWorker$3$1.get(ParameterWorker.java:372)
      • org.apache.tapestry5.corelib.components.PageLink.getfieldvalue_context(PageLink.java)
      • org.apache.tapestry5.corelib.components.PageLink.beginRender(PageLink.java:57)
      • org.apache.tapestry5.corelib.components.PageLink.beginRender(PageLink.java)
      • org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.invokeComponent(ComponentPageElementImpl.java:202)
      • org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:133)
      • org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.render(ComponentPageElementImpl.java:209)

      Replacing the field with:

      public Foo getFoo()

      { return Foo.FOO ; }

      works. There's the workaround, anyway.

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            hlship Howard Lewis Ship
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: