timer function in Interface?

Certified Associate Developer

Hello.

I have and component(card layout) shown in the interface using showWhen() function,

and want it to disappear after 30 seconds.

I thought of using the showWhen() function and refreshInterval of refreshVariable, but couldn't make it work.

I'd appreciate it if you could let me know if there is a way to make this possible.

Thank you.

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    Try something like this. The important part is, that you cannot make this work without a user interaction.

    a!localVariables(
      local!status: true,
      local!show: a!refreshVariable(
        value: local!status,
        refreshOnReferencedVarChange: false,
        refreshInterval: 0.5
      ),
      {
        a!buttonArrayLayout(
          buttons: {
            a!buttonWidget(
              label: "hide",
              value: false,
              saveInto: local!status
            )
          }
        ),
        a!cardLayout(
          contents: {},
          height: "AUTO",
          style: "SUCCESS",
          marginBelow: "STANDARD",
          showWhen: local!show
        )
      }
    )

Reply
  • +1
    Certified Lead Developer

    Try something like this. The important part is, that you cannot make this work without a user interaction.

    a!localVariables(
      local!status: true,
      local!show: a!refreshVariable(
        value: local!status,
        refreshOnReferencedVarChange: false,
        refreshInterval: 0.5
      ),
      {
        a!buttonArrayLayout(
          buttons: {
            a!buttonWidget(
              label: "hide",
              value: false,
              saveInto: local!status
            )
          }
        ),
        a!cardLayout(
          contents: {},
          height: "AUTO",
          style: "SUCCESS",
          marginBelow: "STANDARD",
          showWhen: local!show
        )
      }
    )

Children