Hi!

I have a BasePage with a SignedInPanel and SignedOutPanel. Visibility is
determined according to the apps internal login state AND async javascript
call (external login service). This is done in onConfigure method in
BasePage like this:

@Override
    protected void onConfigure() {
        super.onConfigure();
        /**
         * Check login-status with SPiD async and switch login-panels
according to status.
         */
        checkSpidLoginStatus = new AbstractDefaultAjaxBehavior() {
            @Override
            protected void respond(AjaxRequestTarget target) {
                 
MinSideSession.get().setSpidUsersFirstName(RequestCycle.get().getRequest().getRequestParameters().getParameterValue("user").toOptionalString());

                if (MinSideSession.get().isAuthenticated() &&
MinSideSession.get().getSpidUsersFirstName().equals("UNKNOWN")) {
                    MinSideSession.get().setUser(null);
                    signedInPanel.setVisible(false);
                    signedOutPanel.setVisible(true);
                } else if (MinSideSession.get().isAuthenticated() &&
!MinSideSession.get().getSpidUsersFirstName().equals("UNKNOWN")) {
                    signedInPanel.setVisible(true);
                    signedOutPanel.setVisible(false);
                } else if (!MinSideSession.get().isAuthenticated() &&
!MinSideSession.get().getSpidUsersFirstName().equals("UNKNOWN")) {
                    signedInPanel.setVisible(true);
                    signedOutPanel.setVisible(false);
                } else if (!MinSideSession.get().isAuthenticated() &&
MinSideSession.get().getSpidUsersFirstName().equals("UNKNOWN")) {
                    signedInPanel.setVisible(false);
                    signedOutPanel.setVisible(true);
                }
                target.add(signedOutPanel);
                target.add(signedInPanel);
            }
        };
        add(checkSpidLoginStatus);
    }

Now, this works as expected in development mode (and when deployed on our
tomcat test-server), but when deployed in production both panels became
visible when i log out from the app (only signedOutPanel should be visible).
When i refresh the browser the signedInPanel disappears and everything is
fine again. Similar things happen if i log out of the external login-service
at another site and refreshes "my app".

Any ideas to what this issue might be?

Kind regards
Terje Eithun
Trondheim, Norway

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Panel-visibility-with-AJAX-problem-tp4671307.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to