Note that there are some explanatory texts on larger screens.

plurals
  1. POPrevent Wicket from generating HTML for container elements?
    primarykey
    data
    text
    <p>I'm running into an issue with Wicket generating markup for elements that programmatically need to be there, but not structurally. It's not messing anything up, but I like to keep the page as tidy as possible. It should be noted that I'm a front-end developer, so I'd like to keep my hands out of the java files, if possible.</p> <p>Say I have the following HTML that's part of a component's template:</p> <pre><code>&lt;ul class="configList" wicket:id="rows"&gt; &lt;li wicket:id="cols"&gt; &lt;div wicket:id="checkBoxThing"&gt;&lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>And this is the template for checkBoxThing:</p> <pre><code>&lt;wicket:panel&gt; &lt;div wicket:id="checkboxContainer"&gt; &lt;label wicket:id="label"&gt;&lt;/label&gt; &lt;input type="checkbox" wicket:id="checkbox" name="check" /&gt; &lt;/div&gt; &lt;/wicket:panel&gt; </code></pre> <p>When the page is viewed, the resulting markup looks like this:</p> <pre><code>&lt;ul class="configList&gt; &lt;li&gt; &lt;div&gt; &lt;div id="RandomWicketID"&gt; &lt;label&gt;Checkbox Label&lt;/label&gt; &lt;input type="checkbox" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Those two DIVs inside the LI aren't doing anything structurally or being used for a client-side script; they're just taking up space. Is there something I can do in the template to tell Wicket not to render them? I can't seem to find any parameters I can pass to accomplish this, and no one around the office seems to know.</p> <p>Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload