The image is added to the panel like so:
add(new StaticImage("productImage", "
http://cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg"));
And that uses a convenience constructor I added to the original StaticImage:
package com.vegas.wicket;
import wicket.markup.ComponentTag;
import wicket.markup.html.WebComponent;
import wicket.model.IModel;
import wicket.model.Model;
public class StaticImage extends WebComponent
{
private static final long serialVersionUID = -7600332611457262341L;
public StaticImage(String id, IModel model)
{
super(id, model);
}
public StaticImage(String id, String url)
{
this(id, new Model(url));
}
protected void onComponentTag(ComponentTag tag)
{
checkComponentTag(tag, "img");
tag.put("src", getModelObjectAsString());
}
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user