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 { } else {
final TreeItem item = findItemByActionDefinition( final TreeItem item = findItemByActionDefinition(
navigation.getItems(), navigation.getItems(),
state.definition.activityAnchor()); state.activityAnchor());
if (item != null) { if (item != null) {
final PageAction action = getActivitySelection(item); final PageAction action = getActivitySelection(item);
this.pageService.executePageAction(action, result -> { this.pageService.executePageAction(action, result -> {

View file

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

View file

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