Skip to main content
November 19, 2025
Question

Required Textfield in the editable grid validation not working properly

  • November 19, 2025
  • 4 replies
  • 0 views

Hi All,

i have editable grid in my ui, on that i have textfield which i marked as required. (note: when page loads grid is disabled based on the button action grid will get enabled).

but i have couple of validation for that textfield  that is working but with respective to required condition it is not working. please find below the screenshot and code snippet. Kindly help me on the same.

a!textField(
                          label: "Dental Members",
                          labelPosition: "ABOVE",
                          value: fv!item.dentalEnr,
                          saveInto: {
                            fv!item.dentalEnr,
                            if(
                              contains(
                                touniformstring(index(local!editList, "intakeId", null)),
                                tostring(fv!item.intakeId)
                              ),
                              {
                                a!save(
                                  local!editList,
                                  remove(
                                    local!editList,
                                    wherecontains(
                                      tostring(fv!item.intakeId),
                                      touniformstring(index(local!editList, "intakeId", null))
                                    )
                                  )
                                ),
                                a!save(
                                  local!editList,
                                  append(local!editList, fv!item)
                                )
                              },
                              a!save(
                                local!editList,
                                append(local!editList, fv!item)
                              )
                            )
                          },
                          refreshAfter: "UNFOCUS",
                          showWhen: if(
                            local!region = cons!GSE_SCL_TXT_REGIONS[4],
                            contains(
                              local!showinsureTechColumns,
                              "dentalEnr"
                            ),
                            contains(
                              local!showOtherRegionColumns,
                              "dentalEnr"
                            )
                          ),
                          required: if(
                            a!isNullOrEmpty(fv!item.dentalPremium),
                            false,
                            true
                          ),
                          disabled: if(
                            not(
                              contains(
                                touniformstring(local!editMode),
                                tostring(fv!item.intakeId)
                              )
                            ),
                            true,
                            if(
                              a!isNullOrEmpty(fv!item.dentalPremium),
                              true,
                              false
                            )
                          ),
                          validations: {
                            rule!GSE_SCL_checkNumbersOnlyValidation(
                              searchString: fv!item.dentalEnr,
                              checkMinValue: false
                            ),
                            if(
                              and(
                                a!isNullOrEmpty(fv!item.dentalPremium),
                                a!isNotNullOrEmpty(fv!item.dentalEnr)
                              ),
                              "This field must be left blank if Dental Premium (Annual) is not provided.",
                              
                              if(
                                and(
                                  a!isNotNullOrEmpty(fv!item.dentalPremium),
                                  a!isNullOrEmpty(fv!item.dentalEnr)
                                ),
                                "This field required if dental premium has value ",
                                null
                            ))
                          }
                        ),

4 replies

November 19, 2025

Couple of tips to help troubleshoot:

  • It appears that everything about your data is based upon text rather than numbers, even though the user is supposed to enter a number. Double check that there aren't whitespace characters in the values provided. You might need a trim() call, or better yet, ensure the data model has integers defined for these fields rather than text. You can also avoid the need to validate that a string is a number by using the integerField component, so long as your use case is within integerField limitations.
  • We need more context to understand why validation on the top row has fired to begin with, which may help us understand why the bottom row did not fire. A screenshot that shows us what the grid looks like when not globally disabled should help us with some additional context.
  • The text field's required parameter definition already handles what your validation is attempting to handle. To use your custom message with it, simply pass in the requiredMessage parameter.
stefanhelzle0001
November 20, 2025

Keep in mind that validations only trigger if there is a value. Do not use validations to try to make a field required.

November 20, 2025

yeah ok Stefan. Can you please help me on this case how can i achieve it. my requirement is if premium has value, but member doesn't have value it should throw a message saying this is required. can you please guide me here

harshas2775
November 20, 2025


As per documentation required condition fires when user submits the form. The 2nd row has error due to "validations" , the 2nd last row doesnt have an error because no data is there so "validation" won't act here. The "Required" attribute will be validated on Submit action only. 

'Validations' are triggered by data in field, 'Required' is triggered by Submit form action.