Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8697341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:30:03+00:00 2026-06-13T01:30:03+00:00

AjaxEventBehavior behavior = new AjaxEventBehavior(keyup){ @Override protected void onEvent(AjaxRequestTarget target) { System.out.println(Hello world!); }

  • 0
AjaxEventBehavior behavior = new AjaxEventBehavior("keyup"){

    @Override
    protected void onEvent(AjaxRequestTarget target) {

        System.out.println("Hello world!");
    }
};

form.add(behavior); 

In previous versions of Wicket I could have done it like:

behavior.setThrottleDelay(Duration.ONE_SECOND);

But since version 6.1 this opportunity has been erased. And the web is full of previous versions tutorials which all contain .setThrottleDelay() methods.

Basically, the goal is to call out the behavior when the person has stopped typing in the form. Currently it calls out the behaviour every time INSTANTLY when the key gets up which basically spams the server side. That’s why I would like to delay. Background: I’m currently trying to make queries into database and get out the data which are similar to the form input. And all that in the time when the person is typing. But the delay would be needed in goal to keep server-side/SQL out of the “bombarding range”.

Also I am open to alternatives.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:30:04+00:00Added an answer on June 13, 2026 at 1:30 am

    Setting the throttle’s settings has been unified with all other Ajax settings in AjaxRequestAttributes for version 6.0.0 which is a major version and was not drop-in replacement.

    https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax contains a table with all the settings, the throttling ones are mentioned at the bottom of it.

    To use it :

    AjaxEventBehavior behavior = new AjaxEventBehavior("keyup") {
    
        @Override
        protected void onEvent(AjaxRequestTarget target) {
            System.out.println("Hello world!");
        }
        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
            super.updateAjaxAttributes(attributes);
            attributes.setThrottlingSettings(
                new ThrottlingSettings(id, Duration.ONE_SECOND, true)
            );
        }
    };
    

    The last constructor argument is what you need. Check its javadoc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my droDownBox look like: add(new DropDownChoice<String>(hladaneSlovo, new HladaneSlova()).add(new AjaxEventBehavior(onchange) { private static final long
I have overriden the rowitem from my DefaultDataTable to add some onClick behavior. @Override
I have a form: private Class TestForm extends Form<TestString>{ public TestForm(TestString testString){ super(testForm, new
in my wicket application I have 3 checkbox in form: add(new CheckBox(1).setOutputMarkupId(true)); add(new CheckBox(2).setOutputMarkupId(true));
I'm using apache wicket and I run into trouble regarding testing the AjaxEventBehavior for
I'm having some problems understanding what I'm doing wrong. What I do: Override getHomePage()
This the exception: java.lang.IllegalStateException: this kind of handler cannot be attached to multiple components;
in my form I have input text and then dataView: private class RegistrationForm extends
I have a wicket MultiLineLabel which has its contents coming from database. Now I
I am trying to replace a Label by a TextField in a ListView. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.