Imho, creating a panel is the best solution. Your panel doesn't need to be an external class though:
Public class MyPage extends WebPage { private static class ImagePanel extends Panel { .... } } You can put your makrup into a file named MyPage$ImagePanel.html -Igor > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Gert Jan Verhoog > Sent: Tuesday, August 09, 2005 12:50 AM > To: wicket-user@lists.sourceforge.net > Subject: [Wicket-user] either Label or Image in span, how? > > Hi list, > > [I posted something very similar yesterday, but it never made > it to the list, apparently. Apologies for double posting if > the other one ever arrives] > > I'm using DataTable to render a table. DataTable's markup > fragment for the table cells looks like this: > > <td wicket:id="cells"> > <span wicket:id="cell">[cell]</span> > </td> > > When I'm adding Labels, this poses no problems, but in one of > my columns I'd like to display an image: > > item.add(new Image(componentId, new Model("status-active.jpg"))); > > This (I could've known) gives me an error: > > Component cell must be applied to a tag of type 'img', not > '<span wicket:id="cell">' (line 0, column 0) > > I understand that, but my question is: What's the best way of > dealing with this? I've worked around it by creating a simple > Panel that just has this as its markup: > > <wicket:panel><img wicket:id="img"/></wicket:panel> > > But I'd like to be able to solve this without having to > resort to trivial external Panel classes and html files... > > any ideas? > > cheers, > Gert Jan > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & > EXPO September 19-22, 2005 * San Francisco, CA * Development > Lifecycle Practices Agile & Plan-Driven Development * > Managing Projects & Teams * Testing & QA Security * Process > Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user