Skip to main content
May 2, 2022
Question

Is there some circumstances that required doesn't work on the textfield of interface?

  • May 2, 2022
  • 9 replies
  • 1 view

Hello,

I placed text field in the editable grid and applied required function.
When testing in the interface, the required function is well applied after clicking on submit button.
However, requried function does not apply when testing in the site page.

Are there specific conditions for required function to be applied on the site as well?

Could it be because I tried to use the required function in the record's summary?

Thank you.

    9 replies

    gopalk2865
    Participating Frequently
    May 2, 2022

    Hi, Where are you using this grid? is your form getting submitted without checking required condition?

    harshitb6843
    May 2, 2022

    Please elaborate on your problem more. If possible, include the screenshots and the code. 

    thenmozhim
    August 31, 2022

    Hi [mention:ef600ff8f5d2497eb2def2126dc89484:e9ed411860ed4f2ba0265705b8793d05],

    I am facing the same issue where I have a text field with required set to true and there is no validationGroups added and button validate parameter is also set to true. When this interface is called from record summary view, on button click, the required validation is not working, but the form gets submitted successfully.

    For reference, line no 78 Appian recipe has similar code which is an example to make DB calls from summary view user inputs.

    davel001150
    May 2, 2022

    It's possible that you have configured the button to ignore or skip validation.  It's possible that your input and the submit button are not in the same validation group.  Check these first and then we'll continue trying to isolate the problem (if that's not it).

    May 3, 2022

    Hi, thank you for your advise,

    1. I have checked submit and validate for the button. (no configuration made to ignore or skip validation)

    2. There is no validation group made so every validation should be catched by the button.

    --sample code--

    {
    a!columnsLayout(
    columns: {
    a!columnLayout(
    contents: {
    a!gridLayout(
    label: "Sample Editable Grid",
    labelPosition: "ABOVE",
    headerCells: {
    a!gridLayoutHeaderCell(label: "ItemId"),
    a!gridLayoutHeaderCell(label: "ItemType"),
    a!gridLayoutHeaderCell(label: "ItemSize")
    },
    columnConfigs: {},
    rows: {
    a!forEach(
    items: ri!itemData,
    expression: {
    a!gridRowLayout(
    contents: {
    a!textField(
    label: "Text",
    labelPosition: "ABOVE",
    value: fv!item,
    saveInto: fv!item,
    refreshAfter: "UNFOCUS",
    required: true,
    validations: {}
    ),
    a!textField(
    label: "Text",
    labelPosition: "ABOVE",
    /*value: fv!item,*/
    /*saveInto: fv!item,*/
    refreshAfter: "UNFOCUS",
    required: true,
    validations: {}
    ),
    a!textField(
    label: "Text",
    labelPosition: "ABOVE",
    /*value: fv!item,*/
    /*saveInto: fv!item,*/
    refreshAfter: "UNFOCUS",
    required: true,
    validations: {}
    )
    }
    )
    }
    )

    },
    selectionSaveInto: {},
    validations: {},
    shadeAlternateRows: true
    )
    }
    )
    }
    ),
    a!columnsLayout(
    columns: {
    a!columnLayout(
    contents: {}
    ),
    a!columnLayout(
    contents: {}
    ),
    a!columnLayout(
    contents: {
    a!buttonArrayLayout(
    buttons: {
    a!buttonWidget(
    label: "Button",
    submit: true,
    style: "NORMAL",
    validate: true
    )
    },
    align: "END"
    )
    }
    )
    }
    )
    }

    when testing on interface it works fine

    but with in site page

    the required validation doesn't work

    May 3, 2022

    Hi,

    Are you using this interface inside report and calling that report in your site? If yes, in this case the validation won't work since this interface consider as a report.