When I try to navigate a user asynchronously from the server-side via @Push
like:
ListenableFuture<JobApplicationMatrix> listenableFuture = // some Async method invocation
var ui = UI.getCurrent();
listenableFuture.addCallback(jobApplicationMatrix -> {
ui.access(() -> {
ui.navigate(CandidateComplianceApplicationView.class, new RouteParameters(CandidateComplianceApplicationView.APPLICATION_UUID_PARAMETER, candidateApplicationUuid));
});
}
it is not working as expected. CandidateComplianceApplicationView
is a secured View. When I execute ui.navigate
from ui.access
the system moves me to the Keycloak login page. Looks like the system doesn't understand that the user is logged in. So, is this possible to navigate to the secure view from ui.access
and if so, what am I doing wrong here?
I also tried to change @PermitAll
to @AnonymousAllowed
on CandidateComplianceApplicationView
. In such case the system moves me to the correct page but the actual content of the CandidateComplianceApplicationView
is not rendered at all.
UPDATED
I use
@Push(transport = Transport.LONG_POLLING)