Example usage for org.apache.wicket.ajax.attributes AjaxRequestAttributes setRequestTimeout

List of usage examples for org.apache.wicket.ajax.attributes AjaxRequestAttributes setRequestTimeout

Introduction

In this page you can find the example usage for org.apache.wicket.ajax.attributes AjaxRequestAttributes setRequestTimeout.

Prototype

public AjaxRequestAttributes setRequestTimeout(final Duration requestTimeout) 

Source Link

Document

Sets the timeout in milliseconds for the AJAX request.

Usage

From source file:com.romeikat.datamessie.core.base.ui.panel.StatisticsPanel.java

License:Open Source License

public StatisticsPanel(final String id) {
    super(id);/*w  ww  .  ja  v a  2  s.c o  m*/

    setOutputMarkupId(true);
    add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(SELF_UPDATING_INTERVAL)) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);
            attributes.setRequestTimeout(AJAX_TIMEOUT);
        }
    });

    // Today's history
    final AjaxLazyLoadPanel todaysStatisticsPanel = new AjaxLazyLoadPanel("todaysStatistics") {
        private static final long serialVersionUID = 1L;

        @Override
        public Component getLazyLoadComponent(final String id) {
            final StatisticsPeriodPanel statisticsPeriodPanel = new StatisticsPeriodPanel(id, 1);
            return statisticsPeriodPanel;
        }

        @Override
        protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);
            attributes.setRequestTimeout(AJAX_TIMEOUT);
        }
    };
    add(todaysStatisticsPanel);
}