Actually if the frame is declared in screens.xml
or web-screens.xml
it already has an Id, so no need to assign one in the init()
method of the embedding Frame/Window
.
However, and this is still the case in 6.9, if you put a ‘$’ (dollar) or a ‘.’ (dot) in the frame id filter will not work when embedded.
With a dot you will get: IllegalStateException: Illegal parameter info 'component$'
With a $ you will get something like: IllegalStateException: Illegal parameter info 'component$OrderDetail$browse.filter.date24791'
Both issues comes from the ParametersHelper
pattern matching that does not tolerate that.
This can be confusing, because we are fostered to name our frames like CUBA does, for instance in my case today an embedded frame with a filter named 'app$OrderDetail.browse'
for which I stumbled upon the issue. Make it a Window
and it works.
I think the root issue might be elsewhere, in ConditionDescriptorsTreeBuilderAPI.getFilterComponentName()
(code below). In this method, when the filter name is embedded in a frame it will be prefixed by its frame id. If the filter is embedded in a window, it won’t.
This is due to how ComponentsHelper.getFilterComponentPath()
works, it stops when stumbling upon a Window.
Not sure why there are two semantics here, because filter name for a filter conditions tree is always computed for the frame/window the filter belongs, there is no need to prefix. Especially when this prefix (the frame Id) is subject to limitations it would not have with a window.
Take any generated CUBA screen with a filter named “filter”, and the filter component name wil be “filter”, why not keeping the same for an embedded frame.
protected String getFilterComponentName() {
String filterComponentName = ComponentsHelper.getFilterComponentPath(filter);
String[] parts = ValuePathHelper.parse(filterComponentName);
if (parts.length > 1) {
filterComponentName = ValuePathHelper.format(Arrays.copyOfRange(parts, 1, parts.length));
}
return filterComponentName;
}`
Attached a project allowing to reproduce easily the case.
testcuba5.zip (82.3 KB)