E4 persistence state load issues [message #1778040] |
Fri, 08 December 2017 13:59 |
Josselin Kerdraon Messages: 29 Registered: February 2016 |
Junior Member |
|
|
Hi,
I'm developing a pure-e4 application. I create my views in model fragments, using placeholders to insert them in each perspective.
I wanted to test the workspace persistence system, but when I restart the app, there is a bug, probably due to placeholders.
I catch an IllegalArgumentException when model calls bringToTop function for a view created with a placeholder.
If we see the code of the function:
@Override
public void bringToTop(MUIElement element) {
if (element instanceof MApplication) {
return;
}
MWindow window = getTopLevelWindowFor(element);
if (window == element) {
if (!element.isToBeRendered()) {
element.setToBeRendered(true);
}
window.getParent().setSelectedElement(window);
} else {
showElementInWindow(window, element);
}
UIEvents.publishEvent(UIEvents.UILifeCycle.BRINGTOTOP, element);
}
"element" is the view. getTopLevelWindowFor(element) returns null, so showElementInWindow(window, element); throws an exception.
I guess this problem happens beacause I use Placeholders and fragments. Am I doing something that is not possible ?
EDIT: When I clear persisted state the container of the view is the Trimmed Window. That's why getTopLevelWindowFor doesn't return null.
But when a persisted state is loaded the container is StringModelFragmentImpl....
[Updated on: Fri, 08 December 2017 15:29] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02407 seconds