Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2612

reset() support for DynaActionForm

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Future
    • 1.3.0
    • Core
    • None
    • Operating System: other
      Platform: Other
    • 37057

    Description

      Handling reset() for certain fields in dyna forms would help with the
      requirements of the <html:checkbox> tag.

      There are two approaches I've thought of so far.

      1) Simply reset any boolean fields to false inside reset(). This could cause
      backward-compatibility issues if anyone out there is using boolean fields in
      action forms for anything other than checkboxes.

      2) Allow the user to configure both an initial value and a reset flag. This
      could be something like:

      <form-bean
      name="MyForm"
      type="org.apache.struts.action.DynaActionForm">
      <form-property
      name="firstName"
      type="java.lang.String" />
      <form-property
      name="lastName"
      type="java.lang.String" />
      <form-property
      name="someFlag"
      type="java.lang.String"
      initial="false"
      reset="true"/>
      </form-bean>

      Inside reset(), any property whose "reset" flag is set would be reset to its
      initial value.

      This would require both a DTD change, and a way for the DynaActionForm to know
      what form name it is configured for. For this, FormBeanConfig's
      createActionForm() can be modified to pass along the name onto the
      DynaActionForm it creates.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dsevans93 David Evans
            hrabago@gmail.com Hubert Rabago
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment