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

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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0.5
    • Component/s: tapestry-core
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: