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

Is there any way to append a dynamic link to a text? For example, in a grid I have a column 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. I am trying to figure out how to append or concatenate my text to a dynamic link.

OriginalPostID-193211

OriginalPostID-193211

  Discussion posts and replies are publicly visible

  • You would use a rich text field and a list of load variables that holds the status of each row. On paging this temporary list would need to be cleared to refresh the status.
  • 0
    Certified Lead Developer
    I'm not aware of a way to do that in one column... But here is an idea....
    1. Apply a rule to truncate text and add ....
    2. Add another column with a link
    3. The link can dynamically show a section below with the information expanded when clicked

    Hope that helps and at least gives you one of many alternatives.
  • Depending on the type of grid, you may also choose to use a link in the grid text field to toggle the temporary variable.
  • @erickp Here goes the psuedocode (in case of Paging and Editable Grids) of what you have asked for:

    Paging Grid:
    1. Create a rule which will add some text(Say 'Expand more..' or '& more..') to the existing value when the length of a particular field in record is more than certain length. Do this conditionally, i.e. set a limit, for instance, let's say 10 characters. If a value of less than 10 characters is passed to this rule, this rule won't be applied. Else the text will be truncated and an additional text namely 'Expand more..' or '& more..' etc is appended to actual value.
    2. Create a rule which generates dynamic links based on the value that a field has got for a record. If the value has got characters more than the specified limit, apply the link, else do nothing. In this way, the records which has text more than the specified limit will have a dynamic link associated with them which will be useful for expanding text (in an other sail component) when we click them.
    3. Apply the rule created in Step - 1 to the 'data' attribute of a!gridTextColumn().
    4. Apply the rule created in Step - 2 to the 'links' attribute of a!gridTextColumn().
    5. Associate a variable with the link created in Step - 4 which will be helpful in expanding the text in an other SAIL component when the text associated with dynamic link is clicked.

    Editable Grid:
    1. Make use of a Rich Text Component. Generate the value of it in such a way that the link will be added only if the length of the text (i.e. the size of a field in a particular record) exceeds the desired limit.
    Example:
    load(
    local!variable:"xyz",
    a!richTextDisplayField(
    labelPosition: "COLLAPSED",
    value: {
    if(
    \ tlenb(local!variable)>5,
    \ ta!richTextItem(
    text: {
    local!variable,
    a!richTextItem(
    text: " & more..",
    link: a!dynamicLink(
    value:"& more.."
    \ t
    )
    )
    }
    ),
    \ ta!richTextItem(
    text: {
    a!richTextItem(
    text: local!variable

    )
    }
    )
    \t)
    }
    )
    )

    2. Associate a variable with the link created in Step - 1 which will be helpful in expanding the text in an other SAIL component when the text associated with dynamic link is clicked.