Skip to main content
rishukumarg1965
November 17, 2023
Question

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

  • November 17, 2023
  • 7 replies
  • 0 views

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.

    7 replies

    sriramk5349
    November 17, 2023

    Hi [mention:c7ed152842da4892ba88b9d946100b8f:e9ed411860ed4f2ba0265705b8793d05] ,

    Please go through this pattern link here. Its already there in pattern

    rishukumarg1965
    November 17, 2023

    Above pattern are related to a!gridfield but i want same scenario with the text field with read only mode.

    sriramk5349
    November 17, 2023

    Hi [mention:c7ed152842da4892ba88b9d946100b8f:e9ed411860ed4f2ba0265705b8793d05] ,

    You cannot add a dynamic link to text field. Thats why use rich text display field and specify label and label position. it will act as text field in readonly mode. 

    November 17, 2023

    Hii rishukumarg1965,
    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
            )
          )
        }
      )
    }
    )

    rishukumarg1965
    November 17, 2023

    I try above code but it's not work

    November 17, 2023

    can you please explain so that I can correct it