Tapestry 5
  1. Tapestry 5
  2. TAP5-641

Inherited parameters that are themselves inherited will appear null

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.2
    • Fix Version/s: 5.1.0.4
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      From the mailing list:

      I have a problem with inherit parameter binding in 5.1.0.2 and 5.1.0.1 release (5.0.18 is OK).
      Inherited value is lost if count of inheritance in stack for one component parameter is more than 1 (not sure if this is good description).

      Example will be the best description of my problem...

      First are mentioned responses generated by T5.1 and T5 a bellow is source code for page and components.

      Can you please help me ?
      Is this a bug of T5.1 or inherit binding is discontinued ?

      Thanks

      P.

      Tapestry 5.1.0.2:

      During render of Contact page is lost parameter value for component c3.

      <div>test value by property</div>
      <div>test value by property</div>
      <div></div>

      <div>literal value</div>
      <div>literal value</div>
      <div></div>

      System.out:
      C1.parameter = test value by property
      C2.parameter = test value by property
      C1.parameter = test value by property
      C3.parameter = test value by property
      C2.parameter = test value by property
      C1.parameter = null
      C1.parameter = literal value
      C2.parameter = literal value
      C1.parameter = literal value
      C3.parameter = literal value
      C2.parameter = literal value
      C1.parameter = null

      Tapestry 5.0.18:

      C3 component has its value:
      <div>test value by property</div>
      <div>test value by property</div>
      <div>test value by property</div>

      <div>literal value</div>
      <div>literal value</div>
      <div>literal value</div>

      System.out:
      C1.parameter = test value by property
      C2.parameter = test value by property
      C1.parameter = test value by property
      C3.parameter = test value by property
      C2.parameter = test value by property
      C1.parameter = test value by property
      C1.parameter = literal value
      C2.parameter = literal value
      C1.parameter = literal value
      C3.parameter = literal value
      C2.parameter = literal value
      C1.parameter = literal value

      --------

      Page Contact:

      public class Contact
      {
      public String getValue()

      { return "test value by property"; }

      }

      <html t:type="layout" title="Contact org.example"
      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
      xmlns="tapestry:parameter">

      <p>Contact org.example ...</p>
      <t:c1 parameter="value"/>
      <t:c2 parameter="value"/>
      <t:c3 parameter="value"/>

      <t:c1 parameter="literal:literal value"/>
      <t:c2 parameter="literal:literal value"/>
      <t:c3 parameter="literal:literal value"/>

      </html>

      --------

      Component C1:

      public class C1 {

      @Parameter
      private Object parameter;

      public Object getParameter()

      { return parameter; }

      @BeforeRenderTemplate
      void bedoreTemplate(MarkupWriter writer)

      { System.out.println("C1.parameter = " + String.valueOf(parameter)); }

      }

      <div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">$

      {parameter}

      </div>

      --------

      Component C2:

      public class C2 {

      @Parameter
      private Object parameter;

      @BeforeRenderTemplate
      void bedoreTemplate(MarkupWriter writer)

      { System.out.println("C2.parameter = " + String.valueOf(parameter)); }

      }

      <t:c1 xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" t:parameter="inherit:parameter" />

      --------

      Component C3:

      public class C3 {

      @Parameter()
      private Object parameter;

      @BeforeRenderTemplate
      void bedoreTemplate(MarkupWriter writer)

      { System.out.println("C3.parameter = " + String.valueOf(parameter)); }

      }

      <t:c2 xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" t:parameter="inherit:parameter" />

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        Yep, this does happen, just don't know why!

        Show
        Howard M. Lewis Ship added a comment - Yep, this does happen, just don't know why!

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development