That sort of worked (rendered "wicket:id="list" tags, but not wicket:id="item" tags). However in case of the DOJO-based tree, since tags for each node (along with a bunch of attribute) need to be written, I needed the opposite.

HOWEVER, your suggestion gave me an idea for a variation and it works!
    item.setRenderBodyOnly(true);
    item.add(new Label("item"));

Basically, ask the "item" object to not render its tag, which is exactly what I wanted.

Thanks a bunch!

As for the tree, it is showing other kinds of problems, but they seem like DOJO problems.

p.s. It seems like for ListItem (and I am guessing for LoopItem), setRenderBodyOnly(true) should be the default, since otherwise unexpected markup (repeated parent element) will show up.

-Ramnivas

Martijn Dashorst wrote:
Change the markup to:

<div>
<div wicket:id="list"><span wicket:id="item"></span></div>
</div>

and your listview:

populateItem(Item item) {
    item.add(new Label("item").setRenderBodyOnly(true));
}

Names may have been changed, due to negligence of my memory.

Martijn


On 3/30/06, Ramnivas Laddad <[EMAIL PROTECTED]> wrote:
Hi,

I am continuing my attempt to create a DOJO-based tree (Thanks Igor for
the urlFor() tip).

Currently, I am facing a problem of extra markup emitted in a listview.
I think there is something wrong with my code, but can't quite figure
out what. I am using 1.2-beta2.

Here is a short program that illustrates the problem:

Markup:
<html>
    <body>
        <div wicket:id="list">
            <div wicket:id="item">item text</div>
        </div>
    </body>
</html>

Home and list class:
public class ListViewHome extends WebPage {
    public ListViewHome() {
        List testList = new ArrayList();
         testList.add("one");
        testList.add("two");
        testList.add("three");
        add(new TestListView("list", testList));
    }
}

class TestListView extends ListView {
    public TestListView(String id, List list) {
        super(id, list);
    }

    @Override
    protected void populateItem(ListItem item) {
        String itemString = (String)item.getModelObject();
        Label listItemLabel = new Label("item", itemString);
        item.add(listItemLabel);
    }
}

HTML Output produced:

<html>
    <body>
        <div wicket:id="list">
                <div wicket:id="item">one</div>
        </div>
        <div wicket:id="list">
                <div wicket:id="item">two</div>
        </div>
        <div wicket:id="list">
                <div wicket:id="item">three</div>
        </div>
    </body>
</html>

When used with DOJO-tree, the extra markup ("<div wicket:id="list">")
surrounding every node produces unwanted effects.

I will like to have the following output:

<html>
    <body>
        <div wicket:id="list">
                <div wicket:id="item">one</div>
                <div wicket:id="item">two</div>
                <div wicket:id="item">three</div>
        </div>
    </body>
</html>

Please help.

Thanks.

-Ramnivas


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



--
Wicket 1.2 is coming! Write Ajax applications without touching _javascript_!
-- http://wicketframework.org
------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to