Uploaded image for project: 'Click'
  1. Click
  2. CLK-337

Form#clearValues clears hiddenFields

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5 M1, 1.4.1
    • Component/s: None
    • Labels:
      None

      Description

      ClearValues clears the forms hidden fields as well. This is particularly problematic since it can clear the forms submit token.

      I would think this method should not clear hidden fields.

      At the least it should skip the SUBMIT_CHECK button.

      CayenneForm and HibernateForm also uses HiddenFields. Calling clearValues on these forms might be problematic too.

        Activity

        Hide
        sabob Bob Schellink added a comment -

        clearValues won't clear SUBMIT_CHECK HiddenField.

        fixed checked into trunk and backported to 1.4.1

        Show
        sabob Bob Schellink added a comment - clearValues won't clear SUBMIT_CHECK HiddenField. fixed checked into trunk and backported to 1.4.1
        Hide
        medgar Malcolm Edgar added a comment -

        The use case for this method is in a page which is used to create entities, i.e. you save a new entity and then want all the fields cleared so you can reuse the form again to create a new entity. In this scenario with a CayenneForm its important to clear the hidden id value, so the form is in a create new entity state.

        I can see with the SUBMIT_CHECK that you would not want to clear this field, I can also imagine there are other scenarios where you want only to clear some of the fields. I suppose in the latter case it is up to the developer to decide what they need cleard.

        regards Malcolm Edgar

        Show
        medgar Malcolm Edgar added a comment - The use case for this method is in a page which is used to create entities, i.e. you save a new entity and then want all the fields cleared so you can reuse the form again to create a new entity. In this scenario with a CayenneForm its important to clear the hidden id value, so the form is in a create new entity state. I can see with the SUBMIT_CHECK that you would not want to clear this field, I can also imagine there are other scenarios where you want only to clear some of the fields. I suppose in the latter case it is up to the developer to decide what they need cleard. regards Malcolm Edgar

          People

          • Assignee:
            medgar Malcolm Edgar
            Reporter:
            sabob Bob Schellink
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development