Hello,

I have a page with a simple HTML unordered list (<ul>), where part of the list items are static, whereas the rest of them are dynamic. To that end, I've injected a <span> tag at the end of the static items, adding a ListView in order to fill in the "dynamic" part, as follows:

HTML
-----------------------------------------
<ul>
        <li>
                <a href="#">First static item</a>
        </li>
        <li>
                <a href="#">Second static item</a>
        </li>
        <span wicket:id="dynamicItems">
                <li wicket:id="dynamicListItem"></li>
        </span>
</ul>

Code
-----------------------------------------
ListView dynamicItems = new ListView("dynamicItems", someList) {
        protected void populateItem(ListItem item) {
                Label link = new Label("dynamicListItem",
                        "<a href='...'>" + item.getModelObject() + "</a>");
                link.setEscapeModelStrings(false);
                item.add(link);
        }
};

This achieves what I need, but keeps the <span> tags in place (causing some unrelated CSS to miss its target elements). So, the HTML that is produced is as follows...:

<ul>
        <li>
                <a href="#">First static item</a>
        </li>
        <li>
                <a href="#">Second static item</a>
        </li>
        <span><li>First dynamic item</li></span>
        <span><li>Second dynamic item</li></span>
        <span><li>Third dynamic item</li></span>
</ul>

But what I want to achieve is the following "clean" output (notice the absence of <span> tags):

<ul>
        <li>
                <a href="#">First static item</a>
        </li>
        <li>
                <a href="#">Second static item</a>
        </li>
        <li>First dynamic item</li>
        <li>Second dynamic item</li>
        <li>Third dynamic item</li>
</ul>

How can I achieve this?

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to