<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to use required parameter in rich text display field?</title><link>https://community.appian.com/discussions/f/user-interface/34527/how-to-use-required-parameter-in-rich-text-display-field</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to use required parameter in rich text display field?</title><link>https://community.appian.com/thread/132325?ContentTypeID=1</link><pubDate>Tue, 02 Apr 2024 05:55:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:775e6c6e-19bd-4083-81ef-43296807ec06</guid><dc:creator>dilipg9160</dc:creator><description>&lt;p&gt;Thank you Daisy Singh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use required parameter in rich text display field?</title><link>https://community.appian.com/thread/132324?ContentTypeID=1</link><pubDate>Tue, 02 Apr 2024 05:53:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:af68cc11-16c7-4291-9314-eb8a36fa3967</guid><dc:creator>dilipg9160</dc:creator><description>&lt;p&gt;Thank you Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use required parameter in rich text display field?</title><link>https://community.appian.com/thread/132323?ContentTypeID=1</link><pubDate>Tue, 02 Apr 2024 05:53:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8222dc3e-71cf-4ac1-be71-d6e10c25076f</guid><dc:creator>dilipg9160</dc:creator><description>&lt;p&gt;Thank you Shubham&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use required parameter in rich text display field?</title><link>https://community.appian.com/thread/132322?ContentTypeID=1</link><pubDate>Tue, 02 Apr 2024 05:53:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5aa408fa-b147-4460-9846-6e568cb32af4</guid><dc:creator>dilipg9160</dc:creator><description>&lt;p&gt;Thank you David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use required parameter in rich text display field?</title><link>https://community.appian.com/thread/132321?ContentTypeID=1</link><pubDate>Tue, 02 Apr 2024 05:50:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3fe62ced-aea8-423f-9cca-430bb5d6f8c5</guid><dc:creator>daisyMSingh</dc:creator><description>&lt;p&gt;&lt;a href="/members/dilipg9160"&gt;dilipg9160&lt;/a&gt;&amp;nbsp; One of the Approach would be to use Validation like as we will be storing the value at some place and By Default it will be null .&lt;/p&gt;
&lt;p&gt;Hence on Click of Button we can find if its still null it will display an error else we will Proceed .&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Normal if else will Take care of Such .&lt;/p&gt;
&lt;p&gt;Another Approach would be to Disable the Button Until all the Values are not null .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use required parameter in rich text display field?</title><link>https://community.appian.com/thread/132287?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2024 16:00:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3011bb65-2368-4039-92b2-957dd71b967d</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;The Rich Text Display Field of course does not have a &amp;quot;required&amp;quot; parameter as it is, ostensibly, a read-only input.&amp;nbsp; The fact that we can use links and differing stying and icons and fun stuff like that, in order to essentially transform Rich Text into an ad-hoc input, doesn&amp;#39;t actually override the fact that no data is being &lt;em&gt;&lt;strong&gt;inputted into the field&lt;/strong&gt;&lt;/em&gt;, meaning there&amp;#39;s nothing as easy as &amp;quot;use required parameter&amp;quot; to force the user into said action.&lt;/p&gt;
&lt;p&gt;The above responses will work, though (through only a quick glance) it looks like those ad-hoc validations will show up immediately and continue showing up until the value is entered, but also won&amp;#39;t prevent a button click like a normal failed validation would.&amp;nbsp; This is where we can use a Section-level (or form-level) validation using &lt;em&gt;&lt;strong&gt;a!validationMessage()&lt;/strong&gt;&lt;/em&gt;, which has the unique ability to optionally be set to &lt;strong&gt;not evaluate its failure condition until Submit Click&lt;/strong&gt; has been attempted by the user.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/pastedimage1711987130524v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;A portable example with local-only variables is attached:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  
  local!rating: tointeger(null()),
  local!totalStars: 7,
  
  
  a!sectionLayout(
    contents: {
      a!richTextDisplayField(
        /*showWhen: a!isNotNullOrEmpty(local!rating),*/
        label: &amp;quot;Rating&amp;quot;,
        value: {
          a!forEach(
            items: enumerate(local!totalStars)+1,
            expression: {
              a!richTextIcon(
                size: &amp;quot;MEDIUM&amp;quot;,
                icon: if(
                  or(fv!index &amp;gt; local!rating, a!isNullOrEmpty(local!rating)),
                  &amp;quot;star-o&amp;quot;,
                  &amp;quot;star&amp;quot;
                ),
                link: a!dynamicLink(
                  saveInto: {
                    a!save(
                      local!rating,
                      if(fv!item = local!rating, tointeger(null()), fv!item)
                    )
                  }
                ),
                linkStyle: &amp;quot;STANDALONE&amp;quot;
              )
            }
          ),
          
          a!richTextItem(
            size: &amp;quot;SMALL&amp;quot;,
            color: &amp;quot;NEGATIVE&amp;quot;,
            text: {
              char(10),
              &amp;quot;(* Required)&amp;quot;
            }
          )
        }
      ),
      
      a!buttonArrayLayout(
        align: &amp;quot;CENTER&amp;quot;,
        buttons: {
          a!buttonWidget(
            label: &amp;quot;SUBMIT&amp;quot;,
            submit: true(),
            validate: true()
          )
        }
      )
    },
    
    validations: {
      a!validationMessage(
        message: &amp;quot;A rating is required.&amp;quot;,
        showWhen: a!isNullOrEmpty(local!rating),
        validateAfter: &amp;quot;SUBMIT&amp;quot;
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/pastedimage1711987199025v2.png" alt=" " /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/pastedimage1711987216938v3.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use required parameter in rich text display field?</title><link>https://community.appian.com/thread/132278?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2024 15:02:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9ec9e75f-36cc-4ce3-bb0f-1f4fe28b9680</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;&lt;a href="/members/dilipg9160"&gt;dilipg9160&lt;/a&gt;&amp;nbsp; Try this once&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  {
    a!richTextDisplayField(
      label: &amp;quot;Rating&amp;quot;,
      value: {
        a!forEach(
          items: enumerate(ri!totalStars),
          expression: {
            a!richTextIcon(
              icon: if(fv!index &amp;lt;= ri!rating, &amp;quot;star&amp;quot;, &amp;quot;star-o&amp;quot;),
              link: a!dynamicLink(
                value: if(ri!rating = fv!index, 0, fv!index),
                saveInto: ri!rating
              )
            )
          }
        )
      }
    ),
    a!richTextDisplayField(
      value: a!richTextItem(
        text: &amp;quot;Rating parameter must be filled, Please select a rating before submitting.&amp;quot;,
        color: &amp;quot;NEGATIVE&amp;quot;,
        style: &amp;quot;STRONG&amp;quot;
      ),
      showWhen: a!isNullOrEmpty(ri!rating),
      
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use required parameter in rich text display field?</title><link>https://community.appian.com/thread/132273?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2024 14:35:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dafdb880-8f1c-4d93-995f-24f2b1d2d03c</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;Try something like this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
{
a!richTextDisplayField(
  showWhen: a!isNotNullOrEmpty(ri!rating),
  label: &amp;quot;Rating&amp;quot;,
  value: {
    a!forEach(
      items: enumerate(ri!totalStars),
      expression: {
        a!richTextIcon(
          icon: if(
            fv!index &amp;lt;= ri!rating,
            &amp;quot;star&amp;quot;,
            &amp;quot;star-o&amp;quot;
          ),
          link: a!dynamicLink(
            value: if(ri!rating=fv!index, 0, fv!index),
            saveInto: ri!rating
          )
          
        )
      }
    )
  }
),
a!textField(
  showWhen: a!isNullOrEmpty(ri!rating),
  label: &amp;quot;Rating&amp;quot;,
  value: &amp;quot;Rating parameter must be filled&amp;quot;
)
}
)
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>