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
What did you try so far? Buttons have a color attribute which can be made to change on conditions. Some local variable could hold state.
But, do you want to share your use case?
Can you share your use case? for that button is used in
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.
Thank you for the code. Actually I was doing some mistake in logic but now it worked.
I want this answer also Thanks .