Tapestry 5
  1. Tapestry 5
  2. TAP5-35

During an Ajax update, using a "var:" binding prefix causes an exception indicating that the page is not rendering

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.15
    • Fix Version/s: 5.3
    • Component/s: None
    • Labels:
      None

      Description

      Using the var binding within a zone works fine when you load the page, but when you update the zone using an action link the zone doesn't update and an error is logged.

      Caused by: org.apache.tapestry.ioc.internal.util.TapestryException: Failure writing parameter 'value' of component BasicAjax:loop: Component BasicAjax is not rendering, so render variable 'string' may not be updated. [at classpath:joshcan/test/myapp/pages/BasicAjax.tml, line 6, column 49]
      at org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.writeParameter(InternalComponentResourcesImpl.java:273)
      at org.apache.tapestry.corelib.components.Loop._$update_parameter_value(Loop.java)
      at org.apache.tapestry.corelib.components.Loop.begin(Loop.java:282)
      at org.apache.tapestry.corelib.components.Loop.beginRender(Loop.java)
      at org.apache.tapestry.internal.structure.ComponentPageElementImpl$11$1.run(ComponentPageElementImpl.java:338)
      at org.apache.tapestry.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:874)
      ... 66 more
      Caused by: java.lang.IllegalStateException: Component BasicAjax is not rendering, so render variable 'string' may not be updated.
      at org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.storeRenderVariable(InternalComponentResourcesImpl.java:429)
      at org.apache.tapestry.internal.bindings.RenderVariableBinding.set(RenderVariableBinding.java:38)
      at org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.writeParameter(InternalComponentResourcesImpl.java:269)
      ... 71 more

      1. BasicAjax.tml
        0.3 kB
        Josh Canfield
      2. BasicAjax.java
        0.4 kB
        Josh Canfield

        Activity

        Hide
        Hudson added a comment -

        Integrated in tapestry-5.2-freestyle #302 (See https://hudson.apache.org/hudson/job/tapestry-5.2-freestyle/302/)
        TAP5-35: During an Ajax update, using a "var:" binding prefix causes an exception indicating that the page is not rendering

        Show
        Hudson added a comment - Integrated in tapestry-5.2-freestyle #302 (See https://hudson.apache.org/hudson/job/tapestry-5.2-freestyle/302/ ) TAP5-35 : During an Ajax update, using a "var:" binding prefix causes an exception indicating that the page is not rendering
        Hide
        Howard M. Lewis Ship added a comment -

        Glad I looked at this one; the logic that cleans up the RenderVariable map after rendering turns out to create the PerThreadValue for storing the map blindly. This means that every component ends up with a PerThreadValue to store the Map, and an instance of the Map is created just to be discarded.

        Show
        Howard M. Lewis Ship added a comment - Glad I looked at this one; the logic that cleans up the RenderVariable map after rendering turns out to create the PerThreadValue for storing the map blindly. This means that every component ends up with a PerThreadValue to store the Map, and an instance of the Map is created just to be discarded.
        Hide
        Howard M. Lewis Ship added a comment -

        Consistency is one of the four basic tenets, and this represents behavior that works when doing a full page render but inconsistently fails when doing a partial render due to Ajax. Still, there's a perfectly good workaround.

        Show
        Howard M. Lewis Ship added a comment - Consistency is one of the four basic tenets, and this represents behavior that works when doing a full page render but inconsistently fails when doing a partial render due to Ajax. Still, there's a perfectly good workaround.
        Hide
        Howard M. Lewis Ship added a comment -

        I think the message is accurate: BasicAjax itself is not rendering (start to finish), just a Block within it is rendering. There's a great workaround: a real page property.

        Show
        Howard M. Lewis Ship added a comment - I think the message is accurate: BasicAjax itself is not rendering (start to finish), just a Block within it is rendering. There's a great workaround: a real page property.
        Hide
        Josh Canfield added a comment -

        Template file

        Show
        Josh Canfield added a comment - Template file
        Hide
        Josh Canfield added a comment -

        Page class for example

        Show
        Josh Canfield added a comment - Page class for example

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Josh Canfield
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development