*--Suggestion needed with validations--*

For example we have two tabs made of rich text fields one beside the other.

*Company Details    * Employee Details

Step 1: User clicks on company details and fills the form and the validation message triggered for  few of the fields in editbale grid.
Step 2: After filling company details (Contains errors), user clicks on employee details and fills the form(Contains no errors).

Now user is on emplyoyee details page and when user clicks on submit (skipValidation:false), the form gets submitted even though there are errors in company details tab.

Note:
Company details and employe detials are two sections with two diffrenet interface rules, which are called using if() when user clicks on tabs.
User can go to any tab at any time and fill the form.

There are around 15 tabs, each tab has editbale grid with 10 to 20 rows each.As the form will be huge do we divided them into tabs.

Scenarios Tried:
1.Validation Group Doesnt work.
2.Used Button widget with name "Validate" and captured all the errors and shown the errors at top.(This is one possible solution but bit confusing to user)
3.Used button widget submit with name "Preview" and once user clicks on it will be navigated to other screen with all the  tabs
 one below the other, so that user can see errors in next screen (This is second possible solution but there is performance concern as this will be huge form combining all tabs one below the other)


Please suggest  possible solutions.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    karthikk640 ,  We have used below approach for the similar requirement.

     

    • Created buttons(Company Details,Employee Details) with buttonWidget(), and Submit button with buttonWidgetSubmit()
    • Inside with() , I am calling expression rule as.... local!validation : rule!validateFileds() - (user defined..will pass all required fields to validate) for validation...Which will return either Company Details or Employee Details or both .
    • Inide with(), along with above local!validation, I have a choose() - to choose either Company Details or Employee Details based on button action.
    • In form validations:{}..add below snippet..
      • a!validationMessage(
        message: if(
        fn!isnull(
        local!validation 
        ),
        {},
        "Some values need to be filled in " & local!validation 
        ),
        validateAfter: "SUBMIT"
        )

    Hope it will help you...!!!!

  • Thank you very much @ramanjaneyulut..! I have used this but the thing is under each tab form is very huge , with this approach validations can be displayed only at the bottom. So user have to scroll down in order to look into the validations. Any other way to trigger at both top and bottom? I can use grid or rich text fields above the tabs to display errors. But checking is there any other alternative. Please suggest any idea.
  • 0
    Certified Lead Developer
    in reply to karthikk640
    , AFAIK, we can't show the validation message on top...We have to think about alternate approach
    It would be good if we can divide the fields in sections with collapsible enabled to reduce the size of the form at a time.
Reply Children