Validation to BoxLayout Label

Hi,

I am displaying the textfield  inside in box layout. I want to display the error message as box layout if text field is not having the value.

here is the code

      a!forEach(
          items: local!dataSubset,
          expression: a!boxLayout(
            label: " ",
          
            contents: {
              a!sectionLayout(
                label: " ",
               
                contents: a!columnsLayout(
                  columns: {
                    a!columnLayout(
                      contents: {
                        a!columnsLayout(
                          columns: {
                            a!columnLayout(
                            contents:{
                            a!textField(
                              label:"detail",
                              value:ri!excelDetails.CustomerName
                            )
                            }),
                        
                          }
                        )
                      }
                    )
                  }
                ),
               
              ),
           
            },
            style: "#98002E",
            isCollapsible: true,
            isInitiallyCollapsed: true,
            marginBelow: "STANDARD"
           
          )
        )
      Plese help me. thanksin Advance

  Discussion posts and replies are publicly visible

  • Since you have a sectionLayout inside your boxLayout, you can throw a validation to the respective section containing a blank textfield. Hope this gives you an idea on achieving your usecase.

    a!localVariables(
      local!textArray: {
        "A",
        "",
        "B"
      },
      a!forEach(
        items: local!textArray,
        expression: a!boxLayout(
          label: if(
            isnull(
              fv!item
            ),
            "Missing Data !!",
            ""
          ),
          contents: {
            a!sectionLayout(
              validations: if(
                isnull(
                  fv!item
                ),
                "Please provide a value",
                ""
              ),
              contents: {
                a!textField(
                  label: "Detail",
                  labelPosition: "ADJACENT",
                  value: fv!item
                )
              }
            )
          },
          style: if(
            isnull(
              fv!item
            ),
            "ERROR",
            "INFO"
          ),
          marginBelow: "STANDARD"
        )
      )
    )