link showwhen in grid

i have added a link in a selectable grid, when we select that row then the link should be enabled how to configure that

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to KM

    Then you condition is wrong. Wanna share some code?

  • a!gridLayout(
                  headerCells: {
                    a!gridLayoutHeaderCell(label: cons!CR_SF_ALL_LABELS[10]),
                    a!gridLayoutHeaderCell(label: "")
                  },
                  columnConfigs: {
                    a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 2),
                    a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 2)
                  },
                  selectionValue: ri!selected_txt,
                  selectionSaveInto: ri!selected_txt,
                  selectable: true(),
                  rows: a!forEach(
                    items: local!limitsList,
                    expression: a!gridRowLayout(
                      id: fv!item,
                      contents: {
                        a!textField(value: fv!item, readOnly: true()),
                        if(
                          rule!APN_isEmpty(ri!selected_txt),
                          a!textField(readOnly: true()),
                          a!richTextDisplayField(
                            value: a!richTextItem(
                              showWhen: index(ri!selected_txt, fv!item, {}),
                              text: if(
                                local!showLimitData,
                                "Hide Data",
                                "Show Data"
                              ),
                              link: a!dynamicLink(
                                value: not(local!showLimitData),
                                saveInto: if(
                                  local!showLimitData = true(),
                                  a!save(local!showLimitData, false()),
                                  a!save(local!showLimitData, true())
                                )
                              ),
                              color: if(
                                local!showLimitData,
                                "#ff0000",
                                "#00ff00"
                              )
                            )
                          )
                        )
                      }
                    )
                  )
                )

  • 0
    Certified Lead Developer
    in reply to KM

    This is not how the index() function works.  This is a very powerful and useful function but, i'm afraid, it doesn't do what you seemed to want here.

    The good news is the real solution here is probably simpler - you can probably just replace that code with, "ri!selected_txt = fv!item" or something similar to that.