Hi:

Using wicket 1.3.5, I have a MyAbstractExtensibleChoiceAutocompleteBehavior (that extends AbstractDefaultAjaxBehavior, and I think it is a modification of some wicket class) related to the autocomplete feature that inside onComponentRendered method does something like:

cResponse.write(JavascriptUtils.SCRIPT_OPEN_TAG);
cResponse.write("var foo = new Wicket.ExtensibleChoiceAutocomplete ...");
cResponse.write(JavascriptUtils.SCRIPT_CLOSE_TAG);

Then I have a MyTextField subclass that adds this behavior to itself when it's constructed, so the "autocomplete" options are shown properly. MyTextField also adds to itself an AjaxFormComponentUpdatingBehavior("onchange") so we can track the changes and do some stuff.

So here's the thing, I noticed with firebug that every time I change the component's value and the AjaxFormComponentUpdatingBehavior is called, MyTextField is refreshed (added to the target) and the onComponentRendered method of the other behavior is called, and the js tag is added to the one that previously existed. So I have:

<script type="text/javascript".../</script>
<script type="text/javascript".../</script>

...and everytime I change the component's value, one line is added. From what I saw in Wicket.ExtensibleChoiceAutocomplete class, It shouldn't have negative effects, however, I also think it's not a desired effect. Can anyone tell me if this is normal or I'm doing something wrong or whether I shouldn't worry at all?

Thanks,

Esteban

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to