I am developing a e4 application. Initially I have part A. I m displaying A part on start up of application and B part is not visible. In the Part A, I will be displaying HTML Pages with Links. When the user clicks any of the links, I need to open it another Part, B. Both parts will be visible simultaneously like the Tile Windows Vertically of Windows. How to do this ?
If you have a part definition in your application model you can just use EPartService
:
@Inject EPartService partService;
partService.showPart("part id", PartState.ACTIVATE);
which will open the part wherever you placed it in the application model. If you don't want the part shown initially turn off the 'To Be Rendered' flag in the application model entry for the part.
Alternatively you can create a part from a 'Part Descriptor'
MPart part = partService.createPart("part descriptor id");
In this case you need to add the part to one of your part stacks and then show it:
@Inject EModelService modelService;
@Inject MApplication app;
MPartStack partStack = (MPartStack)modelService.find("part stack id", app);
partStack.getChildren().add(part);
partService.showPart(part, PartState.ACTIVATE);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With