Just found the solution to this issue. It doesn't work correct in 2511, but in 2541 it works. So Migrating to 2541 is the solution.
I've also noticed that I forgot to insert this line of code in my theming:
I saw this in the widget documentation. But after I inserted this line of code it still doesn't work in 2511. So migrating to 2541 is still needed.