How to use required parameter in rich text display field?

Hello Everyone,

I am using rich text display field to capture ranting from user.

I want that field to be required and i am not able to figure it out how to do that.

Your help will be appreciated.

Below is the code i am using.

a!richTextDisplayField(

label: "Rating",
value: {
a!forEach(
items: enumerate(ri!totalStars),
expression: {
a!richTextIcon(
icon: if(
fv!index <= ri!rating,
"star",
"star-o"
),
link: a!dynamicLink(
value: if(ri!rating=fv!index, 0, fv!index),
saveInto: ri!rating
),
linkstyle: cons!MMS_DG_LINK_STYLE[2],
color: cons!MMS_DG_BOX_STYLE[2],
size: cons!MMS_DG_LINK_SIZE[1]
)
}
)
}
)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

      Try this once

    a!localVariables(
      {
        a!richTextDisplayField(
          label: "Rating",
          value: {
            a!forEach(
              items: enumerate(ri!totalStars),
              expression: {
                a!richTextIcon(
                  icon: if(fv!index <= ri!rating, "star", "star-o"),
                  link: a!dynamicLink(
                    value: if(ri!rating = fv!index, 0, fv!index),
                    saveInto: ri!rating
                  )
                )
              }
            )
          }
        ),
        a!richTextDisplayField(
          value: a!richTextItem(
            text: "Rating parameter must be filled, Please select a rating before submitting.",
            color: "NEGATIVE",
            style: "STRONG"
          ),
          showWhen: a!isNullOrEmpty(ri!rating),
          
        )
      }
    )

Reply
  • 0
    Certified Senior Developer

      Try this once

    a!localVariables(
      {
        a!richTextDisplayField(
          label: "Rating",
          value: {
            a!forEach(
              items: enumerate(ri!totalStars),
              expression: {
                a!richTextIcon(
                  icon: if(fv!index <= ri!rating, "star", "star-o"),
                  link: a!dynamicLink(
                    value: if(ri!rating = fv!index, 0, fv!index),
                    saveInto: ri!rating
                  )
                )
              }
            )
          }
        ),
        a!richTextDisplayField(
          value: a!richTextItem(
            text: "Rating parameter must be filled, Please select a rating before submitting.",
            color: "NEGATIVE",
            style: "STRONG"
          ),
          showWhen: a!isNullOrEmpty(ri!rating),
          
        )
      }
    )

Children