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

Certified Associate Developer

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.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    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).

  • 0
    Certified Associate Developer
    in reply to Dave Lewis

    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

  • 0
    Certified Lead Developer
    in reply to dreamyoung

    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.

  • 0
    Certified Associate Developer
    in reply to Naresh

    Hi,

    I am using the interface inside the record type summary. 

    I guess this has the same effect as using it in the report .

    Still hope there is some way to use validation work.

    Thank you.

  • 0
    Certified Senior Developer
    in reply to dreamyoung

    Hi Dreamyoung,
    validations need a "submit".  
    Validations are usually for checking, if a certain logic is fulfilled before you submit a form.
    So why do you want to get a validation in a summary, as summaries would not be submitted (as its a summary of the record and no form within a process)?

Reply Children
  • 0
    Certified Lead Developer
    in reply to Richard Michaelis

    Yes.  Let's think about what submit does.  It continues the process on to the next node.  Well, this isn't even in a process.  There's nothing for the submit to achieve. 

    This is a summary.  It's supposed to be a read-only form.  What are user inputs doing on a summary?  They can't be saved; they can't update the record or do any kind of work.  I would take what you have and try rigging it as a related action, then see if the inputs respond correctly.