Interface Buttons

I want to create 4 buttons in interface which initially have no colors but when we click on them it turns to blue color( need the code using for loop)

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Senior Developer

    What is your requirement? Where are these buttons going to be used? 

    Below is a sample how you could manipulate the style of the button or or you can use the similar logic at the color parameter.

    a!localVariables(
      local!values:{1,2,3,4},
      local!selection:0,
      a!buttonArrayLayout(
        buttons: a!forEach(
          items: local!values,
          expression: a!buttonWidget(
            label: concat("button"," ",fv!item),
            value: fv!item,
            saveInto: local!selection,
            style: if(
              local!selection=fv!item,
              "SOLID",
              "OUTLINE"
            )
          )
        )
      )
    )

    your value that is being saved would evaluate the color. here I have written in a!forEach() for understanding. But if you share us the details on where and what an accurate solution can be provided.

Reply
  • +1
    Certified Senior Developer

    What is your requirement? Where are these buttons going to be used? 

    Below is a sample how you could manipulate the style of the button or or you can use the similar logic at the color parameter.

    a!localVariables(
      local!values:{1,2,3,4},
      local!selection:0,
      a!buttonArrayLayout(
        buttons: a!forEach(
          items: local!values,
          expression: a!buttonWidget(
            label: concat("button"," ",fv!item),
            value: fv!item,
            saveInto: local!selection,
            style: if(
              local!selection=fv!item,
              "SOLID",
              "OUTLINE"
            )
          )
        )
      )
    )

    your value that is being saved would evaluate the color. here I have written in a!forEach() for understanding. But if you share us the details on where and what an accurate solution can be provided.

Children