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 6774141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:45:04+00:00 2026-05-26T15:45:04+00:00

My AutoCompleteTextField (getChoices method implemented and working): AutoCompleteTextField<String> objectDescription = new AutoCompleteTextField<String>(objectDescription) { getChoices()

  • 0

My AutoCompleteTextField (getChoices method implemented and working):

AutoCompleteTextField<String> objectDescription = new AutoCompleteTextField<String>("objectDescription") { 
     getChoices() {...}
}

To this textfield I add:

objectDescription.add(new OnChangeAjaxBehavior()) {
     onUpdate() {....}
}

The onUpdate method gets called everytime I write something in my textfield but not when I choose some item from the autocomplete menu. The string from the menu is written to the textfield but only calls the onUpdate when another change is made.

Edit: Before Wicket 1.5 this was working.

  • 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-05-26T15:45:05+00:00Added an answer on May 26, 2026 at 3:45 pm

    Add an AjaxFormComponentUpdatingBehavior("onchange").

    The OnChangeAjaxbehavior() seems to fire at every change (uses the Javascript Wicket.ChangeHandler), like in every key press.

    Using an AjaxFormComponentUpdatingBehavior will add the event listener to onChange javascript events, like in focusing out of the textfield with a different value, or in selecting a value from the autocomplete list.

    Still not sure why doesn’t OnChangeAjaxbehavior extends AjaxFormComponentUpdatingBehavior inherit this logic from AjaxFormComponentUpdatingBehavior, there must be something it’s overriding.

    UPDATE This might well be the reason why onchange javascript events are being ignored when using OnChangeAjaxBehavior. The source code for Wicket.ChangeHandler, found in wicket-ajax.js, sets handlers for different events:

    • Backs up the onchange event handler in onchangeoriginal:
    obj.onchangeoriginal = obj.onchange
    • If the browser is IE, Safari, and some other, it assigns the original onchange event handler to onKeyUp, onpaste and oncut.
    • If not, it assigns the original onchange event handler to onInput.
    • Finally, it always removes the onchange event handler:

      obj.onchange = function(event){
          Wicket.stopEvent(event);
      }

    The code in wicket-autocomplete.js seems to be manually firing the onchange event handler at item selection. Probably it should be checking for obj.onchangeoriginal first.

    So, being this js executed in OnDomReady, I doubt it’s possible to make those two behaviors coexist. Maybe it’s time to file a new JIRA?

    This might be a slightly related issue: WICKET-2424: OnChangeAjaxBehavior + DatePicker do not work together

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

Sidebar

Related Questions

This question follows this: handling to onchange event of AutoCompleteTextField in wicket I'm trying
I have an places autocomplete textfield. With the core drupal autocomplete i am able
I need an AutoCompleteTextField for Wicket which can handle several autocomplete items separated by
First I want to say I saw a site: https://cwiki.apache.org/WICKET/autocomplete-using-a-wicket-model.html Still I have some
I'm retrieving a list of strings from a webservice and I want to list
I have one url which i have to hit every time whenever user enters

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.