Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-1359

The BeanEditForm component should attempt to create its object parameter if it is null

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0
    • 5.0.5
    • tapestry-core
    • None

    Description

      You have to write a bit of minor scaffolding:

      private MyObject _object;

      void onPrepare() {
      if (_object == null)
      _object = new MyObject();
      }

      Seems like the BeanEditForm could do this on its own: check for null, create a new instance, update the parameter at the end of the render or form submission.

      Obviously, this is predicated on the type being a JavaBean with a no-args constructor, and not an interface or abstract class, or anything else more complicated.

      Attachments

        Issue Links

          Activity

            People

              hlship Howard Lewis Ship
              hlship Howard Lewis Ship
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: