How to open a lookup screen on a selected filter configuration

I have a dashboard widget that display the count of items for a any lookup screen and a filter configuration.

refresh()

val screen =
    screenBuilders.lookup(metaDataLookupEntityClass.getJavaClass<Any>(), this).withScreenId(screenId).build()
val filter = screen.window.components.filterIsInstance(Filter::class.java).first()
val configuration = if (confId != null) filter.getConfiguration(confId)
    ?: throw Exception("Filter / Configuration `$confId' not found in screen $browseScreenId")
else {
    filter.currentConfiguration ?: filter.configurations.first() ?: filter.emptyConfiguration
    ?: throw Exception("No filter / Configuration found in screen $browseScreenId")
}
val loadContext = ExtractByCondition(
    dataManager.load(mc.getJavaClass<Any>())
        .condition(configuration.rootLogicalFilterComponent.queryCondition)
).createLoadContext()

labelLb.value = screen.window.caption + if (confId != null) " - " + configuration.name else ""
valueLb.caption = dataManager.getCount(loadContext).toString()

I want open the lookup screen when the user click the counter

click()

screen.show()

But the screen don’t select the exact configuration filter.
How can I configure the lookup screen to display the good configuration ?

You can select a filter configuration using its setCurrentConfiguration() method, for example:

filter.getConfigurations().stream()
        .filter(configuration -> "By last name".equals(configuration.getName()))
        .findFirst()
        .ifPresent(configuration ->
                filter.setCurrentConfiguration(configuration));