Tapestry
  1. Tapestry
  2. TAPESTRY-1359

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

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major 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.

        Issue Links

          Activity

          Howard M. Lewis Ship created issue -
          Howard M. Lewis Ship made changes -
          Field Original Value New Value
          Link This issue incorporates TAPESTRY-1361 [ TAPESTRY-1361 ]
          Hide
          Howard M. Lewis Ship added a comment -

          Should create an instance if possible, and report it clearly if not.

          Show
          Howard M. Lewis Ship added a comment - Should create an instance if possible, and report it clearly if not.
          Howard M. Lewis Ship made changes -
          Assignee Howard M. Lewis Ship [ hlship ]
          Howard M. Lewis Ship made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          Fix Version/s 5.0.5 [ 12312477 ]
          Mark Thomas made changes -
          Workflow jira [ 12399662 ] Default workflow, editable Closed status [ 12569199 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12569199 ] jira [ 12590455 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development