*--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.
  • @ramanjaneyulut .. yeah am currently doing it and the alternate approach I came up with this is at the top am displaying the validations dynamically using rich text. E.g any errors in the section or tab am populating a Boolean variable and displaying that particular section name with errors.
    one more concern what I have is user can preview the form, which contains all the sections (Tabs) one below the other in preview screen so that user can view form in one go, the time taken to load the form is slow, it is taking 5 to 8 seconds to display on click of preview.there are 10 to 15 editable grids with 10 to 20 rows each. Any solution for this to increase performance?
  • 0
    Certified Lead Developer
    in reply to karthikk640

    karthikk640 , Please find the performance of the form. Please find the details .. here and more details

    May be in preview we can design the form with out with(). Here directly we can validate the from (Since we on't have tabs here).

Reply Children