Hi,

I'm working on an extension of AutoCompleteTextField of
wicket-extensions for selecting objects and remembering their identity
in the model, as described in this previous thread
http://www.mail-archive.com/[EMAIL PROTECTED]/msg02820.html
(it avoids the semantic problems described there by changing to a
readonly view as soon as the object has been selected).

This extension, which I would like to contribute to wicketstuff,
reuses most of the existing functionality of the wicket-extension
autocomlete feature. However, in order to avoid massive code
duplication a trivial and non-intrusive extension point in
AbstractAutoCompleteBehaviour is required. Here's the diff, it simply
puts on the initiaization stuff into an overwritable, unique
initHead() method which is called from within renderHead(). So
instead:

   public void renderHead(IHeaderResponse response)
   {
        super.renderHead(response);
        response.renderJavascriptReference(AUTOCOMPLETE_JS);
        ...
    }

I need

    public void renderHead(IHeaderResponse response)
    {
        super.renderHead(response);
        initHead(response);
    }


    protected void initHead(IHeaderResponse response) {
        response.renderJavascriptReference(AUTOCOMPLETE_JS);
        ...
    }

The reason is obvious: I need to overwrite this to include my own
extended Javascript but I also need a call to super.renderHead().

Since this is perfectly downwards compatible, is there any chance to get
this into wicket 1.4 ?

In addition, I modified wicket-autocomplete.js, so that the
Wicket.AutoComplete Javascript ojbect is subclassable (needs also only
a handful of changes). 

I created a JIRA issue (WICKET-1651) for this including patches for both
extensions, whereas for me the former (initHead()) extension is much
more important (though the later would be nice, too, so that I
wouldn't need to copy javascript code)

BTW, what do I have to do for adding a new wickstuff project ?

bye ....
... roland


-- 
View this message in context: 
http://www.nabble.com/Extensionpoints-for-AbstractAutoCompleteBehaviour-tp17364335p17364335.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.

Reply via email to