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 Lead Developer

    Try something like this.

    a!localVariables(
    {
    a!richTextDisplayField(
      showWhen: a!isNotNullOrEmpty(ri!rating),
      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!textField(
      showWhen: a!isNullOrEmpty(ri!rating),
      label: "Rating",
      value: "Rating parameter must be filled"
    )
    }
    )
    

Reply
  • 0
    Certified Lead Developer

    Try something like this.

    a!localVariables(
    {
    a!richTextDisplayField(
      showWhen: a!isNotNullOrEmpty(ri!rating),
      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!textField(
      showWhen: a!isNullOrEmpty(ri!rating),
      label: "Rating",
      value: "Rating parameter must be filled"
    )
    }
    )
    

Children