Prevent HTML wicket creation for container elements?

I am having a problem with Wicket markup for elements that should be programmatically there, but not structurally. It's not a mess, but I like to keep the page as neat as possible. It should be noted that I am a third-party developer, therefore, if possible, I would like to leave my hands out of java files.

Let's say that I have the following component HTML:

<ul class="configList" wicket:id="rows">
    <li wicket:id="cols">
        <div wicket:id="checkBoxThing"></div>
    </li>
</ul>

And this is the template for checkBoxThing:

<wicket:panel>
    <div wicket:id="checkboxContainer">
        <label wicket:id="label"></label>
        <input  type="checkbox" wicket:id="checkbox" name="check" />
    </div>
</wicket:panel>

When the page is viewed, the resulting layout is as follows:

<ul class="configList>
    <li>
        <div>
          <div id="RandomWicketID">
             <label>Checkbox Label</label>
             <input type="checkbox" />
          </div>
        </div>
    </li>
</ul>

DIV LI script; . -, , Wicket ? , - , , .

!

+3
3

< wicket: container > .

: Wicket ( IIRC), - . , Wicket (. https://cwiki.apache.org/WICKET/how-to-remove-wicket-markup-from-output.html).

configList:

<ul class="configList" wicket:id="rows">
    <li wicket:id="cols">
        <wicket:container wicket:id="checkBoxThing" />
    </li>
</ul>

checkBoxThing:

<wicket:panel>
    <wicket:container wicket:id="checkboxContainer">
        <label>Checkbox Label</label>
        <input type="checkbox" />
    </wicket:container>
</wicket:panel>

( ):

<ul class="configList>
    <li>
        <label>Checkbox Label</label>
        <input id="foo" type="checkbox" />
    </li>
</ul>
+14

<wicket:container> .

<ul class="configList" wicket:id="rows">
    <li wicket:id="cols">
        <wicket:container wicket:id="checkBoxThing"></wicket:container>
    </li>
</ul>

, . https://cwiki.apache.org/WICKET/wickets-xhtml-tags.html

+2

Another option is Component # setRenderBodyOnly (true).

+1
source

All Articles