Menu Item not active - wrong urlQueryParameters usage

Hello guys,

Using latest jmix 2.0.2 I have trouble with menu. No item is marked selected. never. I would like to have it selected as in https://demo.jmix.io/ui-samples/ .

So I did some debugging and I found out that HighlightConditions.sameLocation() is always false because RouterLink.getHref() is always ending with “?” . So it compares “customers” with “customers?”.

So I dig a bit more and find out that question mark is added in RouterLink, because queryparams are not null, but empty:

Fix was done here:

In jmix is always called ListMenuBuilder.createViewMenuItem() and there JmixListMenu.ViewMenuItem .withUrlQueryParameters() which always sets urlQueryParams nonnull.

I want to ask for suggestion how to fix it in JMIX app. Is there way how to work around this? Maybe there is a way how to configure menu differently? How it is that it is working in UI samples? Or wait for version with upgraded Vaadin?

Thank you,
Jakub

Hi,

the upcoming Jmix v2.1 doesn’t have this problem. 2.1.0-RC1 is already available.

Screenshot 2023-10-31 at 13.42.04

Regards,
Gleb

1 Like

Yes, I can confirm that in 2.1. I dont have this problem. Thank you