Tapestry 5
  1. Tapestry 5
  2. TAP5-668

BeanModel documentation should be more clear that a property must exist when using add(String).

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.18
    • Fix Version/s: 5.1.0.5
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Following examples I've found on the web I created the following method in a Page class so I could have additional columns appear in the grid component:

      public BeanModel getModel()

      { BeanModel<Experiment> model = beanModelSource.createDisplayModel(Experiment.class, resources.getMessages()); model.add("edit"); model.add("delete"); return model; }

      A RuntimeException is throw within the call to model.add("edit"). It complains that the "edit" property does not exist. If I pass 'null' as the conduit (i.e. model.add("edit", null) ) It works fine.
      The JavaDoc seems to indicate that I can just add a new property to the model using the original form of the call but it seems to not working that way in 5.0.18.

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        Added a test (to ensure that you get a valid, useful exception – not a NPE) and updated the JavaDoc on BeanModel to better identify what the methods do.

        Show
        Howard M. Lewis Ship added a comment - Added a test (to ensure that you get a valid, useful exception – not a NPE) and updated the JavaDoc on BeanModel to better identify what the methods do.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development