Tapestry
  1. Tapestry
  2. TAPESTRY-1932

Extend PropertyModel to allow access to annotations associated with the property

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.6
    • Fix Version/s: 5.0.11
    • Component/s: Framework
    • Labels:
      None

      Description

      Oftentimes I have to work with beans that I do not have the source for. These beans come out of a library that is shared amongst other apps or out of a third party library. As such, annotating fields with the "Validate" annotation or the proposed "PropertyType" annotation (see TAPESTRY-1931) are not possible.

      What would be great is if the PropertyModel exposed these customizations via API additions. Then, during model customization, one could do something similar to the following:

      model.add("some_text_property").addValidation("required")

      Or:

      model.add("some_text_property").setType("longtext")

        Activity

        Kevin Menard created issue -
        Kevin Menard made changes -
        Field Original Value New Value
        Component/s Framework [ 11280 ]
        Hide
        Howard M. Lewis Ship added a comment -

        Most of the things you want to do, outside of validation, are already supported by BeanModel and PropertyModel.

        Show
        Howard M. Lewis Ship added a comment - Most of the things you want to do, outside of validation, are already supported by BeanModel and PropertyModel.
        Hide
        Howard M. Lewis Ship added a comment -

        I've been of two minds on this, for instance, when I was working on adding support for @Width. It's a question of where logic should live (to avoid duplication). Ultimately, support for @Width maybe wasn't implemented the correct way and that logic should be inside AbstractTextField rather than inside BeanModelSourceImpl/PropertyModelImpl.

        Show
        Howard M. Lewis Ship added a comment - I've been of two minds on this, for instance, when I was working on adding support for @Width. It's a question of where logic should live (to avoid duplication). Ultimately, support for @Width maybe wasn't implemented the correct way and that logic should be inside AbstractTextField rather than inside BeanModelSourceImpl/PropertyModelImpl.
        Howard M. Lewis Ship made changes -
        Assignee Howard M. Lewis Ship [ hlship ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Howard M. Lewis Ship added a comment -

        This really went into a different direction, where PropertyModel implements AnnotationProvider and logic related to annotations can move right into the components themselves, where appropriate. For example, got rid of the width() and getWidth() methods on PropertyModel, and put logic related to @Width into AbstractTextField.

        Show
        Howard M. Lewis Ship added a comment - This really went into a different direction, where PropertyModel implements AnnotationProvider and logic related to annotations can move right into the components themselves, where appropriate. For example, got rid of the width() and getWidth() methods on PropertyModel, and put logic related to @Width into AbstractTextField.
        Howard M. Lewis Ship made changes -
        Summary Extend PropertyModel to handle annotation tasks. Extend PropertyModel to allow access to annotations associated with the property
        Howard M. Lewis Ship made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Fix Version/s 5.0.11 [ 12312968 ]
        Resolution Fixed [ 1 ]
        Mark Thomas made changes -
        Workflow jira [ 12417810 ] Default workflow, editable Closed status [ 12569287 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12569287 ] jira [ 12590538 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        94d 35m 1 Howard M. Lewis Ship 26/Feb/08 19:46
        In Progress In Progress Closed Closed
        58m 40s 1 Howard M. Lewis Ship 26/Feb/08 20:44

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development