Hi, Check for JavaScript errors. I guess that you use <wicket:container> for the signedInPanel and the JS code that has to hide it is not able to find it in the DOM. In production mode all <wicket:xyz> elements and attributes are stripped from the response. If this is the problem then just replace <wicket:container> with a <div>.
Martin Grigorov Freelancer. Available for hire! Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Jun 23, 2015 at 9:36 AM, terjeeit <[email protected]> wrote: > 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: [email protected] > For additional commands, e-mail: [email protected] > >
