Combo Box Filter Default Value

Combo Box Filter Default Value

  
Hello,

I'm fairly new to the Outsystems software but I'm learning quite a bit recently. I've hit a roadblock with something and I'm looking for some help.

Right now I have a page with one table being populated by an Advanced Query. This Query is dependent on a Combo Box (Language) which is used to filter results. There must be a filter selected as it doesn't make sense to display results in multiple languages  I'm having erratic behavior with the table results. It looks like a filter is not being selected by default in the Combo Box when the page first loads. How can I set a default filter?

Tim S.
Hi Tim,
thats true the value associated with the variable will be null/ default before the combo has changed. after that it takes the value associated with the selected value in the combo.
you can set the default value for the Variable in preparation with a assign before the query or you can use the default property of the variable.

Hope this helps.
Regards,
Carlos Rocha
Thank you for pointing me in the right direction. I missed the Default Value Parameter for the variable. I am trying to set it now. The Data Type of the variable is "Language Identifier" and it wants a literal value. When I set the value to 2 (LanguageId for French) it says it must be a Languages Identifier literal value. What would be the correct way to set default value of 2?

Thanks again,
Tim S.
if your variable is a identifier you need something like this
IntegerToEntityRefInteger(2)

to make the conversion. I should remeber you that having this hardcoded is not the best aproach, you should have a query to get the language that you want by name or samething like that, and make an assign in the preparation, by doing it this way you can set a Site property with the default language.. and get that language in the query to populate your filter variable..

Regards,
Carlos Rocha
I see your point. I used the GetLanguages query and assign my Session.LanguageId variable to the current language now and then do my Advanced query. It seems to be working fine now. Thanks.