I have a problem using Wicket and JQuery. I am building a tree with a ul/li structure. However, Wicket inserts it's own elements which I just can't get rid of, for instance for such a structure:
<ul>
<li><input type="checkbox"/></li>
<li>
<ul>
<li><input type="checkbox"/></li>
<li><input type="checkbox"/></li>
</ul>
<ul>
You end up getting something like:
<ul>
<span><li><input type="checkbox"/></li></span>
<span><li>
<wicket:panel><ul>
<span><li><input type="checkbox"/></li></span>
<span><li><input type="checkbox"/></li></span>
</ul></wicket:panel>
</span>
<ul>
So, the second code has some garbage which causes some issues with jquery, For instance, if I call the children() and siblings() methods on some elements of the first sample, I will get a consistent result, but with the second example, it just goes terribly complex to keep up with the "structure exceptions" (wicket:panel and span) that the Wicket framework causes.
All I want to do is to be able to set indeterminate checkbox values for which I found a nice jquery script:
http://css-tricks.com/indeterminate-checkboxes/
However, I find no way to make the script "ignore" the elements that Wicket introduces, or a way to adapt the script so that I can find the checkboxes it needs to validate.
What would be a clean approach to solve such an issue? I will be running into more, similar cases where the wicket element structure will be causing jquery scripts that have been tested on a sample page won't work anymore...