fixed PageState bug for pop-up dialogs

This commit is contained in:
anhefti 2019-09-12 10:14:57 +02:00
parent 96cad3155a
commit 3a0ac74bb9
3 changed files with 14 additions and 4 deletions

View file

@ -351,7 +351,7 @@ public class ActivitiesPane implements TemplateComposer {
} else {
final TreeItem item = findItemByActionDefinition(
navigation.getItems(),
state.definition.activityAnchor());
state.activityAnchor());
if (item != null) {
final PageAction action = getActivitySelection(item);
this.pageService.executePageAction(action, result -> {

View file

@ -185,9 +185,11 @@ public class PageServiceImpl implements PageService {
.getUISession()
.getHttpSession();
final PageState pageState = new PageState(action.definition.targetState, action);
log.debug("Set session PageState: {} : {}", pageState, httpSession.getId());
httpSession.setAttribute(ATTR_PAGE_STATE, pageState);
if (action != null && action.definition != null && action.definition.targetState != null) {
final PageState pageState = new PageState(action.definition.targetState, action);
log.debug("Set session PageState: {} : {}", pageState, httpSession.getId());
httpSession.setAttribute(ATTR_PAGE_STATE, pageState);
}
} catch (final Exception e) {
log.error("Failed to set current PageState: ", e);
}

View file

@ -32,10 +32,18 @@ public final class PageState {
}
public Type type() {
if (this.definition == null) {
return null;
}
return this.definition.type();
}
public Activity activityAnchor() {
if (this.definition == null) {
return null;
}
return this.definition.activityAnchor();
}