Search in sources :

Example 1 with AbortException

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

the class WebClient method onBeginRequest.

public void onBeginRequest(WebClientSession webClientSession) {
    Solution solution = getSolution();
    if (solution != null) {
        synchronized (onBeginRequestLock) {
            long solutionLastModifiedTime = webClientSession.getSolutionLastModifiedTime(solution);
            if (solutionLastModifiedTime != -1 && solutionLastModifiedTime != solution.getLastModifiedTime()) {
                if (isClosing() || isShutDown()) {
                    if (((WebRequest) RequestCycle.get().getRequest()).isAjax())
                        throw new AbortException();
                    else
                        throw new RestartResponseException(Application.get().getHomePage());
                }
                refreshI18NMessages(true);
                ((IScriptSupport) getScriptEngine()).reload();
                ((WebFormManager) getFormManager()).reload();
                MainPage page = (MainPage) ((WebFormManager) getFormManager()).getMainContainer(null);
                throw new RestartResponseException(page);
            }
            executeEvents();
        }
    }
}
Also used : WebRequest(org.apache.wicket.protocol.http.WebRequest) RestartResponseException(org.apache.wicket.RestartResponseException) IScriptSupport(com.servoy.j2db.scripting.IScriptSupport) Solution(com.servoy.j2db.persistence.Solution) AbortException(org.apache.wicket.AbortException)

Example 2 with AbortException

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

the class ServoyAjaxPagingNavigator method newPagingNavigationIncrementLink.

/**
 * @see wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator#newPagingNavigationIncrementLink(java.lang.String, wicket.markup.html.navigation.paging.IPageable, int)
 */
@Override
protected Link newPagingNavigationIncrementLink(String id, IPageable pageable, int increment) {
    Link rez = new AjaxPagingNavigationIncrementLink(id, pageable, increment) {

        private static final long serialVersionUID = 1L;

        /**
         * @see wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationIncrementLink#onClick(wicket.ajax.AjaxRequestTarget)
         */
        @Override
        public void onClick(AjaxRequestTarget target) {
            super.onClick(target);
            Page page = findPage();
            if (page != null) {
                WebEventExecutor.generateResponse(target, page);
            } else
                throw new AbortException();
        }
    };
    TabIndexHelper.setUpTabIndexAttributeModifier(rez, tabIndex);
    return rez;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) Page(org.apache.wicket.Page) AjaxPagingNavigationIncrementLink(org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationIncrementLink) AjaxPagingNavigationLink(org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationLink) Link(org.apache.wicket.markup.html.link.Link) AjaxPagingNavigationIncrementLink(org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationIncrementLink) AbortException(org.apache.wicket.AbortException)

Aggregations

AbortException (org.apache.wicket.AbortException)2 Solution (com.servoy.j2db.persistence.Solution)1 IScriptSupport (com.servoy.j2db.scripting.IScriptSupport)1 Page (org.apache.wicket.Page)1 RestartResponseException (org.apache.wicket.RestartResponseException)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 AjaxPagingNavigationIncrementLink (org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationIncrementLink)1 AjaxPagingNavigationLink (org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationLink)1 Link (org.apache.wicket.markup.html.link.Link)1 WebRequest (org.apache.wicket.protocol.http.WebRequest)1