Hi,

I have two Problems with the AutoCompleteBehavior in wicket:

1. Type-Conflict in line 287 of wicket-autocomplete.js:

 function showAutoComplete(){
        var position=getPosition(wicketGet(elementId));
        var container = getAutocompleteContainer();
        var input=wicketGet(elementId);
        var index=getOffsetParentZIndex(elementId);
        container.show();
* -->
container.style.zIndex=(!isNaN(Number(index))?Number(index)+1:index);*
        container.style.left=position[0]+'px'
        container.style.top=(input.offsetHeight+position[1])+'px';
        if(cfg.adjustInputWidth)
          container.style.width=input.offsetWidth+'px';
        visible=1;
        hideShowCovered();
    }

I believe this was introduced with wicket 1.3.5. In version 1.3.4 this line
was:


container.style.zIndex=(Number(index)!=Number.NaN?Number(index)+1:index);

2. No Object in line 77:

function initialize(){
        // Remove the autocompletion menu if still present from
        // a previous call. This is required to properly register
        // the mouse event handler again (using the new stateful
'mouseactive'
        // variable which just gets created)
        var choiceDiv=document.getElementById(getMenuId());
        if (choiceDiv != null) {

choiceDiv.parentNode.parentNode.removeChild(choiceDiv.parentNode);
        }

        var obj=wicketGet(elementId);

   -->  *objonkeydown=obj.onkeydown;*
        objonblur=obj.onblur;
        objonkeyup=obj.onkeyup;
        objonkeypress=obj.onkeypress;

This causes that the autocomplete-List is not shown. But after replacing the
autocompleteField with Ajax it works. I think that initJS, wich is called
onDomReady (see below), is called to early?

This is the AbstractAutoCompleteBehavior.java:
public void renderHead(IHeaderResponse response)
    {
        super.renderHead(response);
        response.renderJavascriptReference(AUTOCOMPLETE_JS);
        final String id = getComponent().getMarkupId();
        String initJS = constructInitJS();
        response.renderOnDomReadyJavascript(initJS);
    }

I use IE6 and the page with the AutocompleteField is quite big.

Has anyone an idea how to get around this?

Regards,
Benjamin

Reply via email to