why not just remove the node using removeChild(x)?

-igor

On Mon, Sep 12, 2011 at 8:32 AM, Martin Grigorov <[email protected]> wrote:
> Hi,
>
> Recently I had to investigate a problem where a component associated
> with <tfoot> didn't disappear after : comp.setVisible(false) +
> target.add(comp).
> The problem was that comp.setOutputMarkupPlaceholderTag(true) was
> missing and the Ajax response for this component looked like:
> <component id="component2" ><![CDATA[]]></component>
>
> Looking at wicket-ajax.js' replaceOuterHtmlXyz() methods I can see
> just unspecified behavior for the case when the new component's text
> representation is "".
>
> For IE and Safari we do:
>       oldElement.outerHTML = text;
>
> For Gecko:
>        var fragment = range.createContextualFragment(text);
>        element.parentNode.replaceChild(fragment, element);
>
> So it seems like the old component should be replaced with new text
> node without value, but it seems there are browser inconsistencies
> like TFOOT in IE7 which just prevent the replacement.
>
> My question is: are there any use cases which rely on the old
> component to be replaced by empty text node instead of <oldName
> style="display:none"></oldName> ?
>
> Just ignore the fact that any following comp.setVisible(true) +
> target.add(comp) wont work. We already know that.
>
> I'm thinking to add a warning log for such cases (invisible w/o
> placeholder tag added to the target) but maybe someone relies on this
> behavior.
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>

Reply via email to