Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-94

Add a "hidden fields" parameter to BeanEditor and BeanEditForm

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Abandoned
    • 5.0.15
    • None
    • None
    • None

    Description

      A "hidden fields" parameter would allow code like this:

      <t:beaneditform t:id="form" object="person" submitLabel="Save" hidden="version"/>

      instead of this:

      <t:beaneditform t:id="form" object="person" submitLabel="Save">
      <!-- Include version in the form to prevent it being updated/refreshed in onActivate(), which would defeat optimistic locking. -->
      <t:parameter name="version">
      <t:hidden t:id="version" value="person.version"/>
      </t:parameter>
      </t:beaneditform>

      Please note this is not the same as using remove, eg:

      <t:beaneditform t:id="form" object="person" submitLabel="Save" remove="version"/>

      which in this example would defeat optimistic locking because version's value would no longer make the round-trip to the client.

      In case it helps, here's what onActivate() might looks like in this example:

      private Long _personId;

      @Persist("flash")
      private Person _person;

      void onActivate(Long id) throws Exception {
      _personId = id;

      if (_person == null) {
      _person = getPersonService().findPerson(_personId);

      if (_person == null)

      { throw new Exception("Person " + _personId + " does not exist."); }

      }
      }

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            geoffcallender Geoff Callender
            Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: