| EPartService is null after hiding a Part [message #642995] |
Fri, 03 December 2010 10:40  |
Mike Moor Messages: 20 Registered: November 2010 Location: Steffisburg, Switzerland |
Junior Member |
|
|
Hi,
I try to change the visible Part by calling a Command. This is the Handler-Code:
public class ShowPart2 {
@Inject
private EPartService service;
@Execute
public void execute() {
MPart partToShow = this.service.findPart("part2");
MPart partToHide = this.service.findPart("part1");
if (partToShow != null) {
if (partToHide != null) {
this.service.hidePart(partToHide);
}
this.service.showPart(partToShow, PartState.VISIBLE);
}
}
}
While debugging i saw the following:
partToShow, partToHide and service are NOT null until hidePart is called. After this, service is null and a NullPointerException is thrown when showPart is called.
How can this be?
thanx,
mike
|
|
|
|
|
|
|
|
|
|
| Re: EPartService is null after hiding a Part [message #645376 is a reply to message #644131] |
Thu, 16 December 2010 14:24   |
Mike Moor Messages: 20 Registered: November 2010 Location: Steffisburg, Switzerland |
Junior Member |
|
|
i step through the code and what i saw is this:
- the part has the same parent as the active part
- the part is not beeing rendered by the PartRenderingEngine because it has already been rendered at startup (the @PostConstruct annotated method was called)
- the @Focus annotated method of the Part is called when i call showPart
but the part is not visible
[Updated on: Fri, 17 December 2010 03:49] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02134 seconds