65
Views
15
Comments
Solved
How to Clear Mandatory Field Validation Errors Dynamically in a Table in Reactive Web

I’ve tried using the OnChange event, but I’m not sure how to clear the validation error dynamically for inputs inside the TableRecords widget. Any guidance or examples would be greatly appreciated! 

2018-12-10 12-16-21
Goncalo Duarte Almeida
Solution

To give a more accurate example I need more context.

Meanwile I suggest add to the list a IsMandatory parameter. 

On my exemple I created a struture with all parameters and one is InMandatory. Create a local variable with the type list of that structure.Drag the list component and a set the source.

Then create a weblock that will receive the record as input and drag into the list widget.

Inside of the weblock set the attribute Mandatory of the input with the value from the input

With this approach  you have a dynamic validation of the input.

 Regards.

Gonçalo Almeida

2025-01-14 07-39-38
Neha Singh

Hi Goncalo Almeida , Thanks for your suggestion.

I'm working on a feature where I have a table with 4 columns, and all fields in the table are mandatory. Initially, there are no rows in the table. I’ve added a button labeled "Add Row" that dynamically adds a new row to the table.

Here’s the functionality I want to achieve:

  1. When a new row is added, users must fill all the fields before saving the data.
  2. If the user tries to save without filling all the fields in any row, it should show an error message like "This field is required" for each empty field in the table.
  3. As the user starts filling in the missing fields, the error message for the respective field should automatically disappear.

I know this can be implemented easily in a form using Widget IDs for validation. However, I’m unsure how to implement this logic for a table where rows are dynamically added and each field needs its own validation.

Could anyone please guide me with:

  • How to dynamically handle validation for each field in each row?
  • How to ensure the error message disappears as soon as the field is filled?

Any step-by-step guidance or examples would be highly appreciated.

Thanks in advance!

2024-10-24 09-34-57
Lady Diane Prado

Hi @Neha Singh! This isn't a dynamic approach but you can try this:
- Add an attribute to the input widget like this. You can change it to class if you want to:

- Add an OnChange event in the widget:

InputWidgetTest.gif
2025-01-14 07-39-38
Neha Singh

Hi Lady Diane Prado,

Thanks For your time, With the help of Form we can do this I know but the thing is I want for List. Could you please suggest me for dynamic Table?

Thanks in Adv!

2024-10-24 09-34-57
Lady Diane Prado

Hi @Neha Singh!, can you share your OML to provide a better solution? Thanks!

2025-01-14 07-39-38
Neha Singh

Please check this oml so may be you'll understand

Table.oml
2025-01-14 07-39-38
Neha Singh

Thank You Goncalo Almeida!

Because of this I got one Idea and I solved my problem

2018-12-10 12-16-21
Goncalo Duarte Almeida
Solution

Hello @Neha Singh 

Sorry for the late response

Glad I could help you.

Meanwhile I check your oml and I did some changes.

Check if it according what you want.

Regards

Gonçalo Almeida

Table_v1.oml
2025-01-14 07-39-38
Neha Singh


Hello Gonçalo,

Thank you for getting back to me, and no worries about the timing! I really appreciate your help.

I’ll take a look at the changes you made to the OML..

Thanks again for your assistance!

Best regards,

Neha Singh

2018-12-10 12-16-21
Goncalo Duarte Almeida
Solution

Hello @Neha Singh 

Sorry for the late response

Glad I could help you.

Meanwhile I check your oml and I did some changes.

Check if it according what you want.

Regards

Gonçalo Almeida

Table_v1.oml
2018-12-10 12-16-21
Goncalo Duarte Almeida
Solution

To give a more accurate example I need more context.

Meanwile I suggest add to the list a IsMandatory parameter. 

On my exemple I created a struture with all parameters and one is InMandatory. Create a local variable with the type list of that structure.Drag the list component and a set the source.

Then create a weblock that will receive the record as input and drag into the list widget.

Inside of the weblock set the attribute Mandatory of the input with the value from the input

With this approach  you have a dynamic validation of the input.

 Regards.

Gonçalo Almeida

2025-01-14 07-39-38
Neha Singh

Hi Goncalo Almeida , Thanks for your suggestion.

I'm working on a feature where I have a table with 4 columns, and all fields in the table are mandatory. Initially, there are no rows in the table. I’ve added a button labeled "Add Row" that dynamically adds a new row to the table.

Here’s the functionality I want to achieve:

  1. When a new row is added, users must fill all the fields before saving the data.
  2. If the user tries to save without filling all the fields in any row, it should show an error message like "This field is required" for each empty field in the table.
  3. As the user starts filling in the missing fields, the error message for the respective field should automatically disappear.

I know this can be implemented easily in a form using Widget IDs for validation. However, I’m unsure how to implement this logic for a table where rows are dynamically added and each field needs its own validation.

Could anyone please guide me with:

  • How to dynamically handle validation for each field in each row?
  • How to ensure the error message disappears as soon as the field is filled?

Any step-by-step guidance or examples would be highly appreciated.

Thanks in advance!

2024-10-24 09-34-57
Lady Diane Prado

Hi @Neha Singh! This isn't a dynamic approach but you can try this:
- Add an attribute to the input widget like this. You can change it to class if you want to:

- Add an OnChange event in the widget:

InputWidgetTest.gif
2025-01-14 07-39-38
Neha Singh

Hi Lady Diane Prado,

Thanks For your time, With the help of Form we can do this I know but the thing is I want for List. Could you please suggest me for dynamic Table?

Thanks in Adv!

2024-10-24 09-34-57
Lady Diane Prado

Hi @Neha Singh!, can you share your OML to provide a better solution? Thanks!

2025-01-14 07-39-38
Neha Singh

Please check this oml so may be you'll understand

Table.oml
2025-01-14 07-39-38
Neha Singh

Thank You Goncalo Almeida!

Because of this I got one Idea and I solved my problem

2018-12-10 12-16-21
Goncalo Duarte Almeida
Solution

Hello @Neha Singh 

Sorry for the late response

Glad I could help you.

Meanwhile I check your oml and I did some changes.

Check if it according what you want.

Regards

Gonçalo Almeida

Table_v1.oml
2025-01-14 07-39-38
Neha Singh


Hello Gonçalo,

Thank you for getting back to me, and no worries about the timing! I really appreciate your help.

I’ll take a look at the changes you made to the OML..

Thanks again for your assistance!

Best regards,

Neha Singh

2024-05-14 05-39-17
Jothikarthika - EONE

Hi Neha Singh,

When we set the built-in validation for a button to "No," clicking the button does not trigger checks for required fields, data types, or other validations.

Refer to the documentation for more information about form validation.

https://success.outsystems.com/documentation/11/building_apps/user_interface/forms/validate_the_fields_of_a_form/

2025-01-14 07-39-38
Neha Singh

Thank you for your time but I want for Table list not for form

2024-05-14 05-39-17
Jothikarthika - EONE


Would you mind setting all entity attributes to "Mandatory" as "No" and also ensuring that the input boxes inside the table have "Is Mandatory" set to False? Thank you!

2025-01-14 07-39-38
Neha Singh

But I want that this field will be mandatory that's the problem. That's the only requirement.

Mandatory Field error message I need to remove automatically after typing on each field

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Neha Singh ,

see this earlier reply, it was for a list, but I'm assuming you can do similar thing in table.

Dorine

2025-01-14 07-39-38
Neha Singh

Hi Dorine Boudry,

But that's an lengthy process , because let's suppose if I've to apply on 100 of Table's then I've to go for each table and I've to apply this and it'll take lot of time to do this...

if it's possible in other way to do this then please let me know

Thanks in adv!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.