You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the meeting on 23.9.2019, Leif created a loose API draft based on the comments presented in the meeting.
The demonstrating code is as follows:
// Simplest possible - maybe not feasible because the portlet API is a mess@VaadinPortletView("myPortlet")
publicclassMaximizedViewOrEditViewextendsMyComponentimplementsVaadinPortletView {
@Overridepublicvoidinit(PortalComponentContextcontext) {
this.addFooBarListener(event -> {
context.sendEvent(some, parameters, here);
});
context.onPortletModeChange(mode -> this.setEdit(mode.equals(PortletMode.EDIT));
context.onEvent((EventRequestrequest, EventResponseresponse) -> {
this.setEventReceived(request.getEvent().getName));
});
booleanisAdmin = context.hasRole("admin");
this.setAdminControlsAvailable(isAdmin);
}
}
// Intermediate level with annotations@PortletApplication(
@EventDefinition(xyz)
)
publicclassMyOtherPortlet {
@RenderMethod("myPortlet")
publicStringdoThings(request) {
if (maximised) {
returnVaadinPortlet.doThings(request, MaximizedViewOrEditView.class);
} else {
return"<img>";
}
}
@EventMethod("someEvent")
publicvoidsomething(EventRequestreq, EventResponseresp) {
VaadinPortlet.dispatchToTheRightComponentInstance(req, resp, MaximizedViewOrEditView.class);
}
}
// Intermediate level with xmlpublicclassMyPortletextendsVaadinPortlet<MaximizedViewOrEditView> {
}
// Advanced case for using different components with separate @PreserveOnRefresh scopes for different render modes, but still using xmlpublicclassMyPortletextendsVaadinPortlet {
@OverrideprotectedClass<? extendsComponent> getRenderDefinition(PortletRequestrequest) {
if (request.getPortletMode().equals(PortletMode.HELP)) {
returnHelpComponent.class;
} elseif (request.getWindowState().equals(WindowState.MAXIMIZED)) {
returnMaximizedViewOrEditView.class;
}
}
doEdit(RenderRequestreq, RenderResponesresp) {
if (maximised) {
super.doEdit(req, resp);
} else {
renderImg(resp);
}
}
}
This code should be formalized and a API draft should be produced in this repository. This API should then be used in the various demonstration projects to validate the design and find problems therein.
The text was updated successfully, but these errors were encountered:
During the meeting on 23.9.2019, Leif created a loose API draft based on the comments presented in the meeting.
The demonstrating code is as follows:
This code should be formalized and a API draft should be produced in this repository. This API should then be used in the various demonstration projects to validate the design and find problems therein.
The text was updated successfully, but these errors were encountered: