427
Views
12
Comments
Solved
How to make MORE than one value as default on dropdown tags (Reactive web)?

Hi there!

I'm using the dropdown tags from OS UI to show statuses, and I would like to put two of them as default values. Then, when user is landing on this page he would see the list filtered according to these two statuses. Is it possible? I know how to put one as the default, but two no clue.


It's a REACTIVE WEB APP :)

2016-04-22 00-29-45
Nuno Reis
 
MVP
Solution

Here it goes Tamirys.


Disclaimer:  I learned this in my PHP days and never thought in a OS specific way to do it :) 


I made an example that filters by day of week. it allows to group weekdays or weekends.

1. I created a struture to feed the dropdown (I could use the Special List section, but OS changes the ids of type text in the dropdown so I don't trust it).

The order by attribute is not relevant. I simply left some space between my special filters and the standard 1 to 7 from the static.

Then on the query I place special conditions.


Nothing fancy and can be expanded when needed.

DateFilters.oml
2025-11-25 13-20-12
Tamirys Silva Barina

Nuno Reis wrote:

Here it goes Tamirys.


Disclaimer:  I learned this in my PHP days and never thought in a OS specific way to do it :) 


I made an example that filters by day of week. it allows to group weekdays or weekends.

1. I created a struture to feed the dropdown (I could use the Special List section, but OS changes the ids of type text in the dropdown so I don't trust it).

The order by attribute is not relevant. I simply left some space between my special filters and the standard 1 to 7 from the static.

Then on the query I place special conditions.


Nothing fancy and can be expanded when needed.

Thanks a lot, I'll try it on this way :)


2019-07-26 07-21-47
Abdul quadir Saifee

Nuno Reis wrote:

Here it goes Tamirys.


Disclaimer:  I learned this in my PHP days and never thought in a OS specific way to do it :) 


I made an example that filters by day of week. it allows to group weekdays or weekends.

1. I created a struture to feed the dropdown (I could use the Special List section, but OS changes the ids of type text in the dropdown so I don't trust it).

The order by attribute is not relevant. I simply left some space between my special filters and the standard 1 to 7 from the static.

Then on the query I place special conditions.


Nothing fancy and can be expanded when needed.

Very good idea, adding filters and filter based on predefined conditions. 


2019-02-13 19-25-39
Vonnelize Haupt

Hi


A dropdown can only be linked to one variable and that variable can only have one value. It is not possible to have two defaults.  I recommend you use a aggregate from your preparation as the source list for the dropdown. Sort  and filter the aggregate so that the two values you prefer shows at the top of the list. You can use a numeric SortOrder attribute to sort the list.

Hope it helps. 

2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello Tamirys.

There is a way. The same way you send null to select all, you can set and send a custom value to select one or other.

Was I clear or should I send an example?

2025-11-25 13-20-12
Tamirys Silva Barina

Nuno Reis wrote:

Hello Tamirys.

There is a way. The same way you send null to select all, you can set and send a custom value to select one or other.

Was I clear or should I send an example?

Please, an example.


2019-03-19 12-24-07
Mariano Picco
 
MVP

Do you mean you're using the Dropdown Select with a List Box? 

2025-11-25 13-20-12
Tamirys Silva Barina

Mariano Picco wrote:

Do you mean you're using the Dropdown Select with a List Box? 

I'm using dropdown tags pattern from Outsystems UI. I'm working on a reactive web.


2025-07-02 19-21-41
Carla Ribeiro da Fonseca

Tamirys Barina wrote:

Hi there!

I'm using the dropdown tag from OS UI to show statuses, and I would like to put two of them as default values. Then, when user is landing on this page he would see the list filtered according to these two statuses. Is it possible? I know how to put one as the default, but two no clue.


Hi Tamirys,

On a traditional wep app, you'll need to use a ListBox widget, which does allow you to have multiple selected values, and lets you pre-select any of them, and then use either the DropDown Select control from the OutSystemsUIWeb library, of, if you're on an older platform version that doesn't have that, Chosen, from the Forge, to make it look nice.

2025-11-25 13-20-12
Tamirys Silva Barina

Carlos Ribeiro da Fonseca wrote:

Tamirys Barina wrote:

Hi there!

I'm using the dropdown tag from OS UI to show statuses, and I would like to put two of them as default values. Then, when user is landing on this page he would see the list filtered according to these two statuses. Is it possible? I know how to put one as the default, but two no clue.


Hi Tamirys,

On a traditional wep app, you'll need to use a ListBox widget, which does allow you to have multiple selected values, and lets you pre-select any of them, and then use either the DropDown Select control from the OutSystemsUIWeb library, of, if you're on an older platform version that doesn't have that, Chosen, from the Forge, to make it look nice.

You missed my title, it is a reactive web app, but thanks!

2016-04-22 00-29-45
Nuno Reis
 
MVP
Solution

Here it goes Tamirys.


Disclaimer:  I learned this in my PHP days and never thought in a OS specific way to do it :) 


I made an example that filters by day of week. it allows to group weekdays or weekends.

1. I created a struture to feed the dropdown (I could use the Special List section, but OS changes the ids of type text in the dropdown so I don't trust it).

The order by attribute is not relevant. I simply left some space between my special filters and the standard 1 to 7 from the static.

Then on the query I place special conditions.


Nothing fancy and can be expanded when needed.

DateFilters.oml
2025-11-25 13-20-12
Tamirys Silva Barina

Nuno Reis wrote:

Here it goes Tamirys.


Disclaimer:  I learned this in my PHP days and never thought in a OS specific way to do it :) 


I made an example that filters by day of week. it allows to group weekdays or weekends.

1. I created a struture to feed the dropdown (I could use the Special List section, but OS changes the ids of type text in the dropdown so I don't trust it).

The order by attribute is not relevant. I simply left some space between my special filters and the standard 1 to 7 from the static.

Then on the query I place special conditions.


Nothing fancy and can be expanded when needed.

Thanks a lot, I'll try it on this way :)


2019-07-26 07-21-47
Abdul quadir Saifee

Nuno Reis wrote:

Here it goes Tamirys.


Disclaimer:  I learned this in my PHP days and never thought in a OS specific way to do it :) 


I made an example that filters by day of week. it allows to group weekdays or weekends.

1. I created a struture to feed the dropdown (I could use the Special List section, but OS changes the ids of type text in the dropdown so I don't trust it).

The order by attribute is not relevant. I simply left some space between my special filters and the standard 1 to 7 from the static.

Then on the query I place special conditions.


Nothing fancy and can be expanded when needed.

Very good idea, adding filters and filter based on predefined conditions. 


UserImage.jpg
sunny wilson


Very helpful and detailed write-up

2023-02-19 09-25-45
Yasir khan

Hi All,

I use Static Entity that have static record

After that i fetch data from database

Take Dropdown tag

Set the properties of Dropdowntag by use of get aggregate which shows


After This Publish the module your dropdown values are coming from static entity by default

Thanks All


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