Tapestry
  1. Tapestry
  2. TAPESTRY-2340

Documentation about informal parameters should reference the @SupportsInformalParameters annotation specifically

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.11
    • Fix Version/s: 5.0.12
    • Component/s: tapestry-core
    • Labels:
      None
    • Environment:
      Tomcat server 5.5 on Ubuntu Linux.

      Description

      I have created a component that looks like this:

      public class HeraldryShieldIMG
      {
      @Parameter(value="64")
      @Property
      private int _width;

      @Parameter(value="76")
      @Property
      private int _height;

      @Parameter(value="literal:Heraldry")
      @Property
      private String _altText;

      @Parameter(required=true)
      private BaseHeraldry _heraldry;

      @Inject
      private ComponentResources _resources;

      @BeginRender
      public void beginRender(MarkupWriter writer)
      {
      Link link = _resources.createPageLink("ShowHeraldryShield", false, new Object[]

      { "shield", _heraldry.getBottom(), _heraldry.getTop(), _heraldry.getPattern(), _heraldry.getIcon(), _width, _height }

      );
      writer.element("img",
      "src", link.toAbsoluteURI()+".png",
      "width", ""+_width,
      "height", ""+_height,
      "alt", _altText);

      _resources.renderInformalParameters(writer);
      }

      @AfterRender
      void afterRender(MarkupWriter writer)

      { writer.end(); }

      }

      Now if I use it like this:

      <t:HeraldryShieldIMG heraldry="page.webUser.userAccount.heraldry" align="middle" />

      in a template I would think that the informal parameter "align" would be rendered into my current "img"-tag. It is not. Neither is "style"/"class"/etc. What did I not do, all the examples I can find with _resources.renderInformalParameters(writer); do nothing special to indicate that they accept informal parameters (at least not what I can see). In tapestry 4.x there was an option indicating if a component accepted informal parameters - how is this decided now?

        Activity

        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12569386 ] jira [ 12590643 ]
        Mark Thomas made changes -
        Workflow jira [ 12428657 ] Default workflow, editable Closed status [ 12569386 ]
        Howard M. Lewis Ship made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 5.0.12 [ 12313048 ]
        Assignee Howard M. Lewis Ship [ hlship ]
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        Summary Informal Parameters are not rendered in component generating "img" element Documentation about informal parameters should reference the @SupportsInformalParameters annotation specifically
        Hide
        Emanuel Greisen added a comment -

        You are right, I could not find this anywhere. Retro spectrum it is obvious "..Some components support informal parameters, additional parameters beyond the formally defined parameters...", the word "Supports" could have given me a hint.

        Could there not be a note on the page:

        http://tapestry.apache.org/tapestry5/tapestry-core/guide/parameters.html

        Saying that if you make your own component and want support for informal parameters you must do xxxx, yyyy and zzzz?

        Show
        Emanuel Greisen added a comment - You are right, I could not find this anywhere. Retro spectrum it is obvious "..Some components support informal parameters, additional parameters beyond the formally defined parameters...", the word "Supports" could have given me a hint. Could there not be a note on the page: http://tapestry.apache.org/tapestry5/tapestry-core/guide/parameters.html Saying that if you make your own component and want support for informal parameters you must do xxxx, yyyy and zzzz?
        Hide
        Jan le Roux added a comment -

        Maybe you need to add the @SupportsInformalParameters annotation to your class?

        Show
        Jan le Roux added a comment - Maybe you need to add the @SupportsInformalParameters annotation to your class?
        Emanuel Greisen created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 4h
              4h
              Remaining:
              Remaining Estimate - 4h
              4h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development