Search in sources :

Example 6 with RequestCycle

use of org.apache.wicket.RequestCycle in project servoy-client by Servoy.

the class WebClientSession method logout.

/**
 * Logout is being called by:
 *
 * 1> 2 javascript methods: js_logout and js_exit
 *
 * 2> 2 UserClient methods: closeSolution and shutDown
 *
 * 3> 1 ValueUnbound of the session a> Session time out b> Remove attribute when loading new Solution
 *
 * With 1 and 2 the session can be invalidated. With 3a the session is already invalidating.
 *
 * 3b the session shouldn't be invalidated.
 *
 * If logout calls invalidate then the value unbound will be called again that will call logout again.
 */
public void logout() {
    credentials.clear();
    RequestCycle rc = RequestCycle.get();
    if (rc != null) {
        rc.setRedirect(false);
        invalidate();
    } else if (httpSession != null) {
        try {
            httpSession.invalidate();
        } catch (RuntimeException ex) {
        // ignore can be that it is already (being) invalidated.
        }
    }
    httpSession = null;
}
Also used : RequestCycle(org.apache.wicket.RequestCycle)

Example 7 with RequestCycle

use of org.apache.wicket.RequestCycle in project servoy-client by Servoy.

the class ScrollResponseHeaderContainer method setScrollMode.

/**
 * scroll mode is not supported in Internet Explorer 7 and will always set scroll mode to false in this case
 * @param scrollMode
 */
public void setScrollMode(boolean scrollMode) {
    this.isScrollMode = scrollMode;
    RequestCycle requestCycle = RequestCycle.get();
    if (requestCycle != null) {
        ClientProperties cp = ((WebClientInfo) WebClientSession.get().getClientInfo()).getProperties();
        if (cp.isBrowserInternetExplorer() && cp.getBrowserVersionMajor() != -1 && cp.getBrowserVersionMajor() < 8) {
            // $NON-NLS-1$ //$NON-NLS-2$
            Debug.warn("Cannot set tableview to scroll mode for IE version " + cp.getBrowserVersionMajor() + ", UA : " + cp.getNavigatorUserAgent());
            this.isScrollMode = false;
        }
    }
}
Also used : WebClientInfo(org.apache.wicket.protocol.http.request.WebClientInfo) ClientProperties(org.apache.wicket.protocol.http.ClientProperties) RequestCycle(org.apache.wicket.RequestCycle)

Aggregations

RequestCycle (org.apache.wicket.RequestCycle)7 Page (org.apache.wicket.Page)2 WebRequestCycle (org.apache.wicket.protocol.http.WebRequestCycle)2 WebResponse (org.apache.wicket.protocol.http.WebResponse)2 IApplication (com.servoy.j2db.IApplication)1 IDebugWebClient (com.servoy.j2db.IDebugWebClient)1 IFormController (com.servoy.j2db.IFormController)1 Form (com.servoy.j2db.persistence.Form)1 Solution (com.servoy.j2db.persistence.Solution)1 Style (com.servoy.j2db.persistence.Style)1 EmptyRequest (com.servoy.j2db.server.headlessclient.EmptyRequest)1 ShowUrlInfo (com.servoy.j2db.server.headlessclient.MainPage.ShowUrlInfo)1 WebClient (com.servoy.j2db.server.headlessclient.WebClient)1 WebClientsApplication (com.servoy.j2db.server.headlessclient.WebClientsApplication)1 IFieldComponent (com.servoy.j2db.ui.IFieldComponent)1 Settings (com.servoy.j2db.util.Settings)1 Point (java.awt.Point)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 AbstractRestartResponseException (org.apache.wicket.AbstractRestartResponseException)1