Tag Color per Year
Application Type
Traditional Web
Service Studio Version
11.11.4 (Build 43498)

Hello All,

i have set 3 tags in my traditional web application.

Clicking on them, the year is changed per item. For example if i click on the first tag, then the year variable set to 2020 etc.

My request is to change the background color to red to the last clicked tag.


Any idea

Solution

Hi George M,

It will work for Dynamic scenario also

I will attach the oml here.


Regards,

Ellakkiya.S

ReferenceWEB.oml

mvp_badge
MVP

Hi George M,


On your Tag widget, on the Color attribute, you should write a condition to apply the color red if the value of your variable is the year you want. Something like this example where Year is the name of my variable :

 

You will then need to apply a different condition on each year of course.

As you are working on Traditional Web, don't forget to AJAX refresh the tags after changing the value of the variable so the new changes can be reflected on the screen.


Kind Regards,
João

Thank you very much for your reply.

For the cases in which the buttons are dynamically generated from an aggregation? how can i change the background color on the last clicked button? 

mvp_badge
MVP

Hi George,


In that case, instead of comparing the variable that holds the year selected (in my example, the variable is called Year) with 2021 like I did, you should compare it to the attribute of the Table Records / List Records widget which holds the year.

So it would be something like:

If(<your variable with the selected year> = <ListRecords / Table Records>.List.Current.MyTable.<Entity>.<Attribute with the year value>, Entities.Color.Red, NullTextIdentifier())


Kind Regards,
João

Thank you for your reply.

I am referring for the cases in which there is not something to compare. The only condition to change the background color to red is the last selected button.

Hi George M,

To change the background color on the last clicked button

Step1 : while tag onclick, you need to save the current row number of the list record in local variable

Step 2:  Check the condition in color tag property

Step 3 : AJAX refresh the tag widget.

herewith i also attached the URL

https://ellakkiya-selvadurai23.outsystemscloud.com/Reference_WEB/Tag.aspx?_ts=637593602371785372


Regards,

Ellakkiya.S

Thank you for your reply.

Your approach can affect for the cases in which the tags are dynamically generated every time?

The oml sharing is highly appreciated 

Solution

Hi George M,

It will work for Dynamic scenario also

I will attach the oml here.


Regards,

Ellakkiya.S

ReferenceWEB.oml

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.