Forum Discussion

Clinkscake's avatar
Clinkscake
New Contributor III
2 years ago

Button selection color

Currently, there is an option to change the "hover color" on button components. Is there an option to change the color once the button is selected? In my current dashboard, we have multiple buttons and it would be nice if the button a user selects would change colors, then it is apparent they are on that button.

  • This would be a good enhancement for IdeaStream. Currently, I have only seen it done by writing a XFBR String BR to change the image. The XFBR String would go in the "Image URL Or Full File Name" on the button.

  • EricOsmanski's avatar
    EricOsmanski
    Valued Contributor

    This would be a good enhancement for IdeaStream. Currently, I have only seen it done by writing a XFBR String BR to change the image. The XFBR String would go in the "Image URL Or Full File Name" on the button.

    • Clinkscake's avatar
      Clinkscake
      New Contributor III

      Do you happen to have anything you can share to change the image or example business rule? When we try to create a business rule using literal parameters, it doesn't work. 

      • Sergey's avatar
        Sergey
        Contributor III

        Hello,

        First, define the backgroundcolor of your button with something like this : "... BackgroundColor = XFBR(YourBusinessRuleName, YourFunctionName, variable1 = YourVariable) ..."

        YourVariable, most likely, could be a parameter that will be set to "true" when you click on your button.

        Then, play around with this code in YourBusinessRuleName XFBR below. It will have darkblue color if true, black if false.

         

        If (args.FunctionName.XFEqualsIgnoreCase("YourFunctionName")) Then

        ' Get the variable :
        Dim str_variable1 As String = args.NameValuePairs("Variable1")

        ' Initiate the output : 
        Dim buttonColor as string = Nothing

          If str_Variable1 = "True"   Then
        buttonColor = "XFDarkBlueBorder"
        Else
        buttoncolor = "XFBlack"
        End If

        Return buttonColor 

        End If

        Regards,