Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-18142

Setting a Form Field to required through Javascript is triggering a formFieldValueChanged Event

    Details

    • Bug Priority:
      Category 3
    • ACT Numbers:

      00776965

    • Sprint:
      Docs Sprint 18

      Description

      Summary

      The Customer is using Client Side Javascript to dynamically set Form Fields to required. In this scenario, the Customer is executing the Javascript in the formRendered Event.

      scope.findFormFieldWithId(scope.allFormFields, 'drop1').required = true;
      

      This works fine if the formRendered Event is being triggered for the user task for the first time. However, the issue is that when the task is saved and later returned to, the Javascript setting a form field to required in the formRendered Event is triggering a formFieldValueChanged Event. This is an undesired trigger of the formFieldValueChanged Event.

      The formFieldValueChanged Event is not triggered the first time the formRendered Event is triggered which is why it is deemed unexpected behavior by the customer.

      Steps to Reproduce

      1. Seup Activiti 1.5.2.1
      2. Login as Administrator to activiti-app
      3. Via Kickstart, import and publish the attached zip "Save Rendered.zip"
      4. Start a process with this app. Note that the form field is set to Required but a formFieldValueChanged Event is not triggered.
      5. Save the form and refresh the page.

      Expected Behavior
      The form field should be marked as required via formRendered and a formFieldValueChanged Event is Not triggered.

      Actual Behavior
      When the user task is revisited after saving, the formRendered Event Javascript is executed. This time setting a form field to required is triggering the formFieldValueChanged Event. This is an undesired trigger as a form field value has not actually been changed.

        Attachments

          Structure

            Activity

              People

              • Assignee:
                mhowarth Mark Howarth
                Reporter:
                ccollins Cody Collins
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Structure Helper Panel