Started using Wicket and found a problem ;-)

To reproduce a bug:
1. Make a simple page with a form containing AutoCompleteTextField and
IndicatingAjaxSubmitButton.
2. In a page-class create a Form, add IndicatingAjaxSubmitButton and then
AutoCompleteTextField.
That's all, your AutoCompleteTextField is not working :-)
BUT, if you change the order of adding components to form so that you first
add AutoCompleteTextField and then IndicatingAjaxSubmitButton all is going
to be ok.

I've created a minimal sample
ftp://public.ntu-kpi.kiev.ua/incoming/wicket_bug/ac_bug.zip 
This sample reflects my real life situation: parent page with part of the
form + child page with some controls added.

Sneaking through sources I've found a problem here:

wicket.behavior.AbstractBehavior

        public final void renderHead(final Response response)
        {
                Set contributors = (Set)headContribHolder.get();

                // were any contributors set?
                if (contributors == null)
                {
                        contributors = new HashSet(1);
                        headContribHolder.set(contributors);
                }

                // get the id of the implementation; we need this trick to be
                // able to support multiple implementations
                String implementationId = getImplementationId();

                // was a contribution for this specific implementation done yet?
                if (!contributors.contains(implementationId))
                {
                        onRenderHeadInitContribution(response); 
<--------------------
                        contributors.add(implementationId);
                }

                onRenderHeadContribution(response);
        }

<----- is called just once, so if AutoCompleteTextField is first in a list
of page children, then it adds common ajax js's and autocomplete required
js, and if IndicatingAjaxSubmitButton is first in a list of page children,
then it adds just common ajax js's to header.

Can you suggest a patch to this problem ?
-- 
View this message in context: 
http://www.nabble.com/AutoCompleteTextField-conflict-tf2163954.html#a5980949
Sent from the Wicket - User forum at Nabble.com.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to