Tapestry 5
  1. Tapestry 5
  2. TAP5-566

TextField documentation should explain why the required value parameter is not bound in the example

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.18
    • Fix Version/s: 5.1.0.2
    • Component/s: documentation
    • Labels:
      None

      Description

      At http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/TextField.html there is an example for Payment.tml

      <t:label for="cardNumber"/>:
      <t:textfield t:id="cardNumber" validate="required,regexp" size="20"/>

      It is missing the required parameter "value".

        Activity

        Borut Bolcina created issue -
        Hide
        Thiago H. de Paula Figueiredo added a comment -

        From the documentation of the value parameter:
        "If not bound, a default binding is made to a property of the container matching the component's id. If no such property exists, then you will see a runtime exception due to the unbound value parameter."
        In this example, the textfield is bound to the cardNumber property.

        Show
        Thiago H. de Paula Figueiredo added a comment - From the documentation of the value parameter: "If not bound, a default binding is made to a property of the container matching the component's id. If no such property exists, then you will see a runtime exception due to the unbound value parameter." In this example, the textfield is bound to the cardNumber property.
        Hide
        Borut Bolcina added a comment -

        But there is no

        @Property
        private String cardNumber;

        in the example.

        It is confusing if the Flags says Required, and the explanation says "...if not bound then..."

        Show
        Borut Bolcina added a comment - But there is no @Property private String cardNumber; in the example. It is confusing if the Flags says Required, and the explanation says "...if not bound then..."
        Hide
        Howard M. Lewis Ship added a comment -

        It is still required, but we're saying that Tapestry can attempt to bind it for you. That won't always work, in which case it is an error if you neither you nor Tapestry can bind the parameter.

        Show
        Howard M. Lewis Ship added a comment - It is still required, but we're saying that Tapestry can attempt to bind it for you. That won't always work, in which case it is an error if you neither you nor Tapestry can bind the parameter.
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        Summary Error in documentation for TextField component. TextField documentation should explain why the required value parameter is not bound in the example
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Howard M. Lewis Ship made changes -
        Assignee Howard M. Lewis Ship [ hlship ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 5.1.0.2 [ 12313706 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development