Uploaded image for project: '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
    • Status: Closed
    • Priority: 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

        Hide
        thiagohp 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
        thiagohp 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
        borutb 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
        borutb 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
        hlship 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
        hlship 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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development