[KULRICE-7532] required validation fails in StackedCollectionSubSection addLine Created: 22/Jun/12  Updated: 03/Apr/13  Resolved: 07/Nov/12

Status: Closed
Project: Kuali Rice Development
Component/s: Development
Affects Version/s: 2.2.0-m1
Fix Version/s: 2.2.0-rc1, 2.2
Security Level: Public (Public: Anyone can view)

Type: Bug Fix Priority: Critical
Reporter: Bob Hurt (Inactive) Assignee: Brian Smith (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: JPEG File Capture1.JPG    
Issue Links:
Cloners
cloned to KULRICE-8505 Documentation for focusOnIdAfterSubmi... Open
Fix
fixes KSENROLL-1385 Need error message when Adding Key Da... Closed
Rely
is relied upon by KULRICE-8505 Documentation for focusOnIdAfterSubmi... Open
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).



 Comments   
Comment by Brian Smith (Inactive) [ 22/Oct/12 ]

Verify this is still an issue before attempting a fix

Comment by Bob Hurt (Inactive) [ 23/Oct/12 ]

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.

Comment by Brian Smith (Inactive) [ 26/Oct/12 ]

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?

Comment by Bob Hurt (Inactive) [ 26/Oct/12 ]

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.

Comment by Brian Smith (Inactive) [ 26/Oct/12 ]

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

Comment by Bob Hurt (Inactive) [ 29/Oct/12 ]
  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
Comment by Brian Smith (Inactive) [ 31/Oct/12 ]

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.

Comment by Brian Smith (Inactive) [ 31/Oct/12 ]

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.

Comment by Brian Smith (Inactive) [ 31/Oct/12 ]

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.

Comment by Brian Smith (Inactive) [ 06/Nov/12 ]

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

Comment by Bob Hurt (Inactive) [ 06/Nov/12 ]

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.

Comment by Brian Smith (Inactive) [ 06/Nov/12 ]

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)

Comment by Bob Hurt (Inactive) [ 06/Nov/12 ]

okay, that makes sense.

Comment by Brian Smith (Inactive) [ 07/Nov/12 ]

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

Comment by Jerry Neal (Inactive) [ 08/Nov/12 ]

Hi Brian,

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

thanks,
Jerry

Generated at Sun Jul 12 20:29:05 CDT 2020 using JIRA 6.1.5#6160-sha1:a61a0fc278117a0da0ec9b89167b8f29b6afdab2.