Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-98153

Rules to show fields fail when multiple rules are needed to show the same fields

    Details

      Description

      Rule execution fails in certain circumstances, particularly when multiple rules are required to perform actions on the same fields or groups of fields.

      As a Forms Designer I need to create a form that uses a "Select from List" or "Single Selection" to enable the Forms Submitter to select whether 1, 2, 3 (or more) sets of fields are displayed.  This should be able to be accomplished with multiple rules as follows:

      1. If "select from list" = "1" then show first set of fields
      2. If "select from list" = "2" then show first and second set of fields
      3. If "select from list" = "3" then show first, second and third sets of fields
      4. And so on... (and if "0" don't show anything)

      The business scenario in this case is as follows:

      The form is a "School Enrolment" form, allowing a Parent to apply to send their child to school.  The question being asked is "How many siblings (brothers or sisters) does your child have?", which will require the parent to enter First Name, Last Name, Date of Birth and Gender for each sibling.  If they answer "0" to the question, then no fields should be displayed.  If they answer "1" they should be able to fill in the details for that one sibling, "2" for two, "3" for three and so on.

      Expected behaviour:

      Form Submitter sees the appropriate number of sets of fields based on their selection

      Actual behaviour:

      It appears that only the final rule (in the above example, "3") is executed, otherwise no fields are displayed at all - i.e. if the user selects "3" then three sets of fields are displayed, if they select any other option then no fields are displayed at all.

      Implementation Details:

      One "select from list" field (or "single selection" - behaviour is identical) with options defined for 0, 1, 2, and 3.  Label "How many siblings does your child have?", name "HowManySiblingsDoesYourChildHave"

      "First Name", "Last Name", "Date of Birth" and "Gender" fields (Text, Text, Date, Single Selection) named FirstName1, FirstName2, FirstName3, LastName1, LastName2, LastName3, DateOfBirth1, DateOfBirth2, DateOfBirth3, Gender1, Gender2, Gender3

      Three rules:

       

      If Field 'How many siblings does your child have?' is equal to Value 1
      Show 'First Name', 
      And Show 'Last Name',
      And Show 'Date of Birth',
      And Show 'Gender'
      
      If Field 'How many siblings does your child have?' is equal to Value 2
      Show 'First Name', 
      And Show 'Last Name',
      And Show 'Date of Birth',
      And Show 'Gender',
      And Show 'First Name', 
      And Show 'Last Name',
      And Show 'Date of Birth',
      And Show 'Gender'
      
      If Field 'How many siblings does your child have?' is equal to Value 3
      Show 'First Name', 
      And Show 'Last Name',
      And Show 'Date of Birth',
      And Show 'Gender',
      And Show 'First Name', 
      And Show 'Last Name',
      And Show 'Date of Birth',
      And Show 'Gender',
      And Show 'First Name', 
      And Show 'Last Name',
      And Show 'Date of Birth',
      And Show 'Gender'

      (In addition to the described bug, this UX is not helpful as it is not clear for the Form Designer which fields have been selected when the field labels need to be non-unique)

      Screenshots attached.

       

        Attachments

          Activity

            People

            Assignee:
            renato.rego Renato Rêgo
            Reporter:
            benjamin.turner Benjamin Turner
            Participants of an Issue:
            Recent user:
            Yunlin "Steven" Sun
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 24 weeks, 3 days ago

                Packages

                Version Package
                7.2.10 DXP FP9
                7.2.X
                7.3.4 CE GA5
                7.3.10 DXP GA1
                Master