Skip to main content
June 26, 2024
Question

how to set up dynamiclink when switching between interfaces

  • June 26, 2024
  • 3 replies
  • 0 views

Please tell me how to set up dynamiclink when switching between interfaces.

3 replies

sriramk5349
June 26, 2024

Hi [mention:d2124109f9a24537b6b333d9b3ab2bb7:e9ed411860ed4f2ba0265705b8793d05] , Below code might be helpful

a!localVariables(
  local!test:true,
  {
    a!richTextDisplayField(
      value: {
        a!richTextItem(
          text: "change text",
          link: a!dynamicLink(
            value: not(local!test),
            saveInto: local!test
          ),
          linkStyle: "STANDALONE"
        )
      }
    ),
    a!richTextDisplayField(
      value: "true",
      showWhen: local!test
    ),
    a!richTextDisplayField(
      value: "false",
      showWhen: not(local!test)
    )
  }
)

June 26, 2024

I am not sure about your use case but try using the following snippet.

Here I have taken choose() and declared identifying interfaces via numbers.

Depending on your use you can either use this or use if else.


a!localVariables(
  local!showInterface:1,
  a!sectionLayout(
    label: "INTERFACE 1",
    contents: {
      a!sideBySideLayout(
        items: {
          a!sideBySideItem(
            item: a!richTextDisplayField(
              value: a!richTextItem(
                text: "Redirect to interface 1",
                link: a!dynamicLink(value: 1, saveInto: local!showInterface)
              )
            )
          ),
          a!sideBySideItem(
            item: a!richTextDisplayField(
              value: a!richTextItem(
                text: "Redirect to interface 2",
                link: a!dynamicLink(value: 2, saveInto: local!showInterface)
              )
            )
          )
        }
      ),
      choose(
        local!showInterface,
        rule!EMS_TEST_INTERFACE_1(),
        rule!EMS_TEST_INTERFACE_2()
      )
    }
  )
)

July 1, 2024

Thank you everyone for your advice.