Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-7532

required validation fails in StackedCollectionSubSection addLine

    Details

    • Type: Bug Fix Bug Fix
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2.0-m1
    • Fix Version/s: 2.2.0-rc1, 2.2
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-9586Need to avoid required validation checks on addLine
      KULRICE-7110Conditional requirement bug in a Collection's addline
      KULRICE-11813Update Collection Addline in Lightbox AFT to check validation tooltip
      KULRICE-12923addLine does not work inside addDialog when used in a StackedCollection
      KULRICE-12581addViaLightBox validating addLineGroup when the light box is not rendered
      KULRICE-13053View dialogs with required fields cause client-side validation to always fail
      KULRICE-6665Validation being skipped for some field types on an addLine js call
      KULRICE-11064Progressive Render - Required field validation issue on Save button click
      KULRICE-6666Validation causes Javascript error with an addLine containing a checkbox or radio
      KULRICE-14043QuickFinder on Collection AddLine causes JavaScript Errors
    • Rice Module:
      KRAD
    • KRAD Feature Area:
      UIF Component
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      we have a single DropDownControl field in the addLine of a Uif-Disclosure-StackedCollectionSubSection that is required, and the first option has a key="" and value="Select Keydate Group Type". if the field is put into focus and then the "add" button for the addLine is clicked, the "Required" error appears as expected but there is no window.alert that says something like "This addition contains errors. Please correct these errors and try again." if the user does NOT put the dropdown into focus before clicking "add", there is no validation error at all - the "Updating" overlay appears briefly and then the page is redisplayed exactly as before; the user gets no feedback as to what happened.

      the StackedCollectionSubSection is a list item in the subCollections property of a Uif-Disclosure-StackedCollectionSection. the parent collection also has a dropdown field in the addLine which is required, along with two required date fields. when the "add" button is clicked on the parent collection the "Required" errors appear on all three fields and a window.alert appears, as expected. (altho the alert may be getting displayed because of the required date fields).

        Issue Links

          Activity

          Hide
          Brian Smith (Inactive) added a comment -

          Verify this is still an issue before attempting a fix

          Show
          Brian Smith (Inactive) added a comment - Verify this is still an issue before attempting a fix
          Hide
          Bob Hurt (Inactive) added a comment - - edited

          the original problem has been resolved, but there is now a new, related problem.

          after the subcollection is added, clicking on the addLine "add" button to add a record to the subcollection causes the subcollection dropdown to be highlighted as a required error. that should only happen when the add button for the subcollection is clicked. i'll attach a screenshot (Capture1.JPG) to show what i'm trying to describe.

          Show
          Bob Hurt (Inactive) added a comment - - edited the original problem has been resolved, but there is now a new, related problem. after the subcollection is added, clicking on the addLine "add" button to add a record to the subcollection causes the subcollection dropdown to be highlighted as a required error. that should only happen when the add button for the subcollection is clicked. i'll attach a screenshot (Capture1.JPG) to show what i'm trying to describe.
          Hide
          Brian Smith (Inactive) added a comment -

          I cannot reproduce what is in the image. Do these two fields/control happen to somehow have the same id? Only way I can see this happening. Can you show me the xml as well?

          Show
          Brian Smith (Inactive) added a comment - I cannot reproduce what is in the image. Do these two fields/control happen to somehow have the same id? Only way I can see this happening. Can you show me the xml as well?
          Hide
          Bob Hurt (Inactive) added a comment -

          see beans "KS-KeyDatesGroup-EditSubSection" and "KS-KeyDates-EditSubSection", defined about half-way into this file:
          https://svn.kuali.org/repos/student/enrollment/ks-enroll/trunk/ks-enroll-ui/src/main/resources/org/kuali/student/enrollment/acal/AcademicTermPage.xml
          let me know if you'd prefer that I copy the xml into here.

          Show
          Bob Hurt (Inactive) added a comment - see beans "KS-KeyDatesGroup-EditSubSection" and "KS-KeyDates-EditSubSection", defined about half-way into this file: https://svn.kuali.org/repos/student/enrollment/ks-enroll/trunk/ks-enroll-ui/src/main/resources/org/kuali/student/enrollment/acal/AcademicTermPage.xml let me know if you'd prefer that I copy the xml into here.
          Hide
          Brian Smith (Inactive) added a comment -

          Is this live anywhere I could try it, I don't see an issue in the xml

          Show
          Brian Smith (Inactive) added a comment - Is this live anywhere I could try it, I don't see an issue in the xml
          Hide
          Bob Hurt (Inactive) added a comment - - edited
          1. log into http://env2.ks.kuali.org/portal.do?selectedTab=main
          2. click 2nd-to-last link in left column, "Create Academic Calendar"
          3. click on "Terms" tab
          4. change the Term Type dropdown to "Fall Term", enter 09/01/2013 & 12/31/2013 for the dates, and click the "add" button
          5. change the Key Date Group Type dropdown to "Instructional" and click the "add" button directly underneath the dropdown
          6. click the "add" button in the INSTRUCTIONAL KEY DATES addline and you should see that the Key Date Group Type dropdown is incorrectly flagged as a required error
          Show
          Bob Hurt (Inactive) added a comment - - edited log into http://env2.ks.kuali.org/portal.do?selectedTab=main click 2nd-to-last link in left column, "Create Academic Calendar" click on "Terms" tab change the Term Type dropdown to "Fall Term", enter 09/01/2013 & 12/31/2013 for the dates, and click the "add" button change the Key Date Group Type dropdown to "Instructional" and click the "add" button directly underneath the dropdown click the "add" button in the INSTRUCTIONAL KEY DATES addline and you should see that the Key Date Group Type dropdown is incorrectly flagged as a required error
          Hide
          Brian Smith (Inactive) added a comment - - edited

          This is happening because after the table is refreshed the key date group type is still focused and clicking out of it to click the add button causes a loss of focus, it is not because the add line on the inner collection is firing validation on it, but because the field was focused. The same effect will happen when you click anywhere on the page.

          Show
          Brian Smith (Inactive) added a comment - - edited This is happening because after the table is refreshed the key date group type is still focused and clicking out of it to click the add button causes a loss of focus, it is not because the add line on the inner collection is firing validation on it, but because the field was focused. The same effect will happen when you click anywhere on the page.
          Hide
          Brian Smith (Inactive) added a comment -

          This happens because after the add it re-focuses on the first field of the add line for the collection to allow quick entry of multiple lines.

          Show
          Brian Smith (Inactive) added a comment - This happens because after the add it re-focuses on the first field of the add line for the collection to allow quick entry of multiple lines.
          Hide
          Brian Smith (Inactive) added a comment -

          Not sure what to do other than adding an option to not do this, or not do this by default, will talk to Jerry about it.

          Show
          Brian Smith (Inactive) added a comment - Not sure what to do other than adding an option to not do this, or not do this by default, will talk to Jerry about it.
          Hide
          Brian Smith (Inactive) added a comment -

          Decision is to make what is focused after clicked developer configurable, default will still be first field of line but will be able to be changed

          Show
          Brian Smith (Inactive) added a comment - Decision is to make what is focused after clicked developer configurable, default will still be first field of line but will be able to be changed
          Hide
          Bob Hurt (Inactive) added a comment -

          This happens because after the add it re-focuses on the first field of the add line for the collection to allow quick entry of multiple lines.

          belated comment: by "first field of the add line" do you mean the Key Date Group Type dropdown to add a subcollection, or the Key Date Type dropdown that is the first field of the subcollection's add line? it seems like the focus should be on the latter because that's the add line button that was clicked.

          Show
          Bob Hurt (Inactive) added a comment - This happens because after the add it re-focuses on the first field of the add line for the collection to allow quick entry of multiple lines. belated comment: by "first field of the add line" do you mean the Key Date Group Type dropdown to add a subcollection, or the Key Date Type dropdown that is the first field of the subcollection's add line? it seems like the focus should be on the latter because that's the add line button that was clicked.
          Hide
          Brian Smith (Inactive) added a comment -

          When you click Add in a collection it will refocus on the first field of the add line. In this case it focuses on Key Date Group Type dropdown after you add one, so you can add another one if you wanted to. By instead clicking on the subcollection's add button that field is now losing focus causing a required error to occur (since Key Date Group Type is required to add another one for the parent collection)

          Show
          Brian Smith (Inactive) added a comment - When you click Add in a collection it will refocus on the first field of the add line. In this case it focuses on Key Date Group Type dropdown after you add one, so you can add another one if you wanted to. By instead clicking on the subcollection's add button that field is now losing focus causing a required error to occur (since Key Date Group Type is required to add another one for the parent collection)
          Hide
          Bob Hurt (Inactive) added a comment -

          okay, that makes sense.

          Show
          Bob Hurt (Inactive) added a comment - okay, that makes sense.
          Hide
          Brian Smith (Inactive) added a comment - - edited

          By default LINE_FIRST is now used for focusOnIdAfterSubmit for add line buttons and can be set to any of these:

          • A valid element id
          • "FIRST" will focus on the first visible input element on the form
          • "SELF" will result in this Action being focused (action bean defaults to "SELF")
          • "LINE_FIRST" will result in the first input of the collection line to be focused (if available)
          • "NEXT_INPUT" will result in the next available input that exists after this Action to be focused (only if this action still exists on the page)

          NEXT_INPUT would probably be the best to use to get the functionality you want above

          Show
          Brian Smith (Inactive) added a comment - - edited By default LINE_FIRST is now used for focusOnIdAfterSubmit for add line buttons and can be set to any of these: A valid element id "FIRST" will focus on the first visible input element on the form "SELF" will result in this Action being focused (action bean defaults to "SELF") "LINE_FIRST" will result in the first input of the collection line to be focused (if available) "NEXT_INPUT" will result in the next available input that exists after this Action to be focused (only if this action still exists on the page) NEXT_INPUT would probably be the best to use to get the functionality you want above
          Hide
          Jerry Neal (Inactive) added a comment -

          Hi Brian,

          Please create a documentation Jira for making this update to the KRAD book.

          thanks,
          Jerry

          Show
          Jerry Neal (Inactive) added a comment - Hi Brian, Please create a documentation Jira for making this update to the KRAD book. thanks, Jerry

            People

            • Assignee:
              Brian Smith (Inactive)
              Reporter:
              Bob Hurt (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Structure Helper Panel