Is there any way to append a dynamic link to a text box?

There any way to append a dynamic link to a text field? For example, in a Text field with read only mode that contains a lot of characters. I want to truncate the characters and add a link after it that says "Expand" or "Read More", If they click on it, the user will sees all the text.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hii ,
    As of my knowledge, you can not append a dynamic link to a text field but you can achieve it by using the richTextDisplay Field, hope this will help you
    Thankyou

    a!localVariables(
      local!TextlengthToshow:10,
      local!a:"jsvsbvjsbvjsbvl  visjdvidsbvlsad dsfdf n dvkmsdvsdkjv dsv dsvdsvn",
      local!show:len(local!a)>local!TextlengthToshow,
      {
      a!richTextDisplayField(
        value: {
          a!richTextItem(
            text: if(
              local!show,
              left(local!a,local!TextlengthToshow),
              local!a
            )
          ),
          a!richTextItem(
            text: if(
              local!show,
              " More",
              " Less"
              ),
            link: a!dynamicLink(
              value: not(local!show),
              saveInto: local!show
            )
          )
        }
      )
    }
    )

Reply
  • 0
    Certified Senior Developer

    Hii ,
    As of my knowledge, you can not append a dynamic link to a text field but you can achieve it by using the richTextDisplay Field, hope this will help you
    Thankyou

    a!localVariables(
      local!TextlengthToshow:10,
      local!a:"jsvsbvjsbvjsbvl  visjdvidsbvlsad dsfdf n dvkmsdvsdkjv dsv dsvdsvn",
      local!show:len(local!a)>local!TextlengthToshow,
      {
      a!richTextDisplayField(
        value: {
          a!richTextItem(
            text: if(
              local!show,
              left(local!a,local!TextlengthToshow),
              local!a
            )
          ),
          a!richTextItem(
            text: if(
              local!show,
              " More",
              " Less"
              ),
            link: a!dynamicLink(
              value: not(local!show),
              saveInto: local!show
            )
          )
        }
      )
    }
    )

Children