The problem is not present in 1.2 HEAD.

On 19 Feb 2006, at 16:43, Christian Hvid wrote:

Hi.

Is there any sensible explanation for the following:

I am writing a comments component with the following view / controller:

<html>
<body>

<wicket:panel>

    <h1>Comments</h1>

    <div wicket:id="comments">
        <span wicket:id="text"></span><br/>
        -- <span wicket:id="user"></span>
    </div>

    <div class="Edit">
<input type="button" value="&nbsp;&nbsp;Add Comment&nbsp;&nbsp;"/>
    </div>

</wicket:panel>

</body>
</html>

public class Comments extends Panel {
    static class Comment {
        String text;
        String user;
        Date date;
        Comment(String text, String user, Date date) {
            this.text = text;
            this.user = user;
            this.date = date;
        }
    }
    private List<Comment> comments = new ArrayList<Comment>();
    public Comments(String id) {
        super(id);

comments.add(new Comment("Aloha Hawaii", "peter", new Date ()));

        add(new ListView("comments", comments) {
            public void populateItem(ListItem listItem) {
                Comment comment = (Comment)listItem.getModelObject();

                listItem.add(new Label("text", comment.text));
                listItem.add(new Label("user", comment.user));
            }
        });

    }
}

Which works fine.

However if change the div tag to a p tag for the list view:

<html>
<body>

<wicket:panel>

    <h1>Comments</h1>

    <p wicket:id="comments">
        <span wicket:id="text"></span><br/>
        -- <span wicket:id="user"></span>
    </p>

    <div class="Edit">
<input type="button" value="&nbsp;&nbsp;Add Comment&nbsp;&nbsp;"/>
    </div>

</wicket:panel>

</body>
</html>

The code breaks with a wicket.markup.MarkupException saying that it cannot find component with id text - eventhough it is quite obviously there.

I am using wicket 1.1.1.

-- Christian




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to