Hi,
We are trying to add an option to an autocompletetextfield to allow showing
more alternatives if we have more suggestions than is actually shown. We
want to show this in either a new panel on the original page the
autocomplete is on or showing it in a modal window. In the process we have
copied over some code from the original autocompletetextfield. Our problem
is that the ajax response is just handled in the javascript and never
updated on the page.

What we have done is adding this this to the javascript

  if(
element.firstChild.childNodes[selected].attributes['islink']!=undefined ) {
    var ivalue = wicketGet(elementId).value;
    var request = new
Wicket.Ajax.Request(callbackUrl+"&l="+processValue(ivalue), doEndConv,
false, true, false, "wicket-autocomplete|d");
    request.get();

and

    function doEndConv(resp){
        Wicket.replaceOuterHtml(wicketGet("panel"), resp);
               hideAutoComplete();
        Wicket.Log.info("Response processed successfully.");
        Wicket.Ajax.invokePostCallHandlers();
    }


in respond(AjaxRequestTarget target) in the AbstractAutocompleteBehavior we
have tried to both replacing a panel and opening a modal window when:

  final String link = requestCycle.getRequest().getParameter("l");
  if( link!=null ) {

is there anything here that we should have done differently, or are there
other ways of doing this that are actually working? any experiences? :-)

Reply via email to