Dear Wicket experts,

I want to display a variable sized matrix represented as a List of
Lists of Strings (the sublists do all have the same size). In my page
class I have this code:

        List matrix = getMatrix(); // matrix is a List of Lists of Strings
        add(new ListView("matrix", matrix) {
            protected void populateItem(ListItem row) {
                List rowList = (List) row.getModelObject();
                row.add(new ListView("row", rowList) {
                    protected void populateItem(ListItem dataList) {
                        String data = (String) dataList.getModelObject();
                        dataList.add(new Label("data", data));
                    }
                });
            }
        });

and this is the relevant extract my HTML-template looks like:

        <table border="1" wicket:id="matrix">
            <tr wicket:id="row">
                <td wicket:id="data">Data</td>
            </tr>
        </table>

For a 3x2 sized matrix, what I expexted was that it gets rendered like this:

        <table wicket:id="matrix" border="1">
            <tr wicket:id="row">
                <td wicket:id="data">(1/1)=89</td>
                <td wicket:id="data">(2/1)=87</td>
                <td wicket:id="data">(3/1)=33</td>
            </tr>
        </table><table wicket:id="matrix" border="1">
            <tr wicket:id="row">
                <td wicket:id="data">(1/2)=32</td>
                <td wicket:id="data">(2/2)=83</td>
                <td wicket:id="data">(3/2)=90</td>
            </tr>
        </table>

But instead it renders like this:

        <table wicket:id="matrix" border="1">
            <tr wicket:id="row">
                <td wicket:id="data">(1/1)=89</td>
            </tr><tr wicket:id="row">
                <td wicket:id="data">(2/1)=87</td>
            </tr><tr wicket:id="row">
                <td wicket:id="data">(3/1)=33</td>
            </tr>
        </table><table wicket:id="matrix" border="1">
            <tr wicket:id="row">
                <td wicket:id="data">(1/2)=32</td>
            </tr><tr wicket:id="row">
                <td wicket:id="data">(2/2)=83</td>
            </tr><tr wicket:id="row">
                <td wicket:id="data">(3/2)=90</td>
            </tr>
        </table>

What is wrong with my template and how can I accomplish that the table
is rendered as expected?

Felix


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to