Bas,
Awesome - thanks for find that! I does explain a few things...
My code was something like;
<wicket:panel>
<p><div wicket:id="subComponent1"></div></p>
<div wicket:id="subComponent2"></div>
</wicket:panel>
Which - from your link - would suggest this is a really bad idea... I'm pretty
sure in certain cases this causes the second subComponent2 to render outside
the parent, causing a break in the hierarchy, the Ajax responses to not
correctly identify the existing components, and in turn causing duplicates.
>> There is nothing special in Wicket code about <p> tag.
I didn't think this would be a Wicket issue per se, more of DOM or JQuery
issue, that had a weird knock-on effect on Wicket. I was wondering if Wicket
people had experience of it.
I think the upshot of this; don't use <p> tags for random formatting! :)
Thanks Martin and Bas - all interesting stuff - I appreciate your inputs! :)
Cheers,
Col.
________________________________________
From: Bas Gooren [[email protected]]
Sent: 10 September 2013 05:52
To: [email protected]
Subject: Re: <p> tags!
Could it be related to
http://stackoverflow.com/questions/10763780/putting-div-inside-p-is-adding-an-extra-p
?
I've seen odd behavior before when using block-level elements inside p-tags.
However, from your e-mail it's not entirely clear what your html looks
like. "Subcomponents of mainpanel were wrapped in p-tags" does sound
like you may have divs inside p tags.
Met vriendelijke groet,
Kind regards,
Bas Gooren
Op 9-9-2013 4:28, schreef Colin Rogers:
> Wicketeers!
>
> I have an odd bug, that has been resolved, but I it doesn't explain what and
> why the issue existed - and with a view to avoiding the issue in future, I
> thought I should seek some wisdom! :)
>
> Basically - I have a application where the 'main panel' is replaced as a link
> is clicked (along with other panels, too) - oddly, when I hit certain links
> repeatedly, instead of the mainPanel simply replacing the old version and
> updating, it produced duplicates - no duplicates in the other panels, just
> the mainPanel. Meaning I had the same panel repeated from each click down the
> page.
>
> After tons of reverting on code, hacking and experimenting, I finally found
> the culprit... yep; <p> tags. When any of my sub-components of mainPanel were
> wrapped in <p> tags, it caused the parent to duplicate instead of replace.
> Replace the <p> tag with a <div> and everything works fine. So obviously I
> have a perfectly good solution!
>
> Does anyone have an explanation for this? I'm totally stumped as to why <p>
> tags would cause issues in the DOM?
>
> Cheers,
> Col.
> EMAIL DISCLAIMER This email message and its attachments are confidential and
> may also contain copyright or privileged material. If you are not the
> intended recipient, you may not forward the email or disclose or use the
> information contained in it. If you have received this email message in
> error, please advise the sender immediately by replying to this email and
> delete the message and any associated attachments. Any views, opinions,
> conclusions, advice or statements expressed in this email message are those
> of the individual sender and should not be relied upon as the considered
> view, opinion, conclusions, advice or statement of this company except where
> the sender expressly, and with authority, states them to be the considered
> view, opinion, conclusions, advice or statement of this company. Every care
> is taken but we recommend that you scan any attachments for viruses.
>
EMAIL DISCLAIMER This email message and its attachments are confidential and
may also contain copyright or privileged material. If you are not the intended
recipient, you may not forward the email or disclose or use the information
contained in it. If you have received this email message in error, please
advise the sender immediately by replying to this email and delete the message
and any associated attachments. Any views, opinions, conclusions, advice or
statements expressed in this email message are those of the individual sender
and should not be relied upon as the considered view, opinion, conclusions,
advice or statement of this company except where the sender expressly, and with
authority, states them to be the considered view, opinion, conclusions, advice
or statement of this company. Every care is taken but we recommend that you
scan any attachments for viruses.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]