Hi,
I have the following structure of pages:
default -> Page1 -> Page2
I am trying to create an event listener that reads some property off the currently rendering page and sets it as a value in user session, I did the following:
public PortalNodeEvent onEvent(PortalNodeEventContext ctx,
PortalNodeEvent event) {
if(event instanceof PageRenderEvent)
{
PageRenderEvent renderEvent=(PageRenderEvent) event;
String category=(String)renderEvent.getNode().getProperties().get("category");
ctx.getPortalRuntimeContext().getSession().setAttribute("currentCategory",category );
}
return ctx.dispatch();
}