hello list,
I'd like to have a dynamically generated list of iframes in my page, where
each iframe has the same attributes except for its src attribute, which
should dynamically be inserted.
The iframes are embedded Youtube videos and I have a list of the urls to be
stuck in their src attributes. But my implementation does not work. The
error I get is
Last cause: A child with id 'videoframe' already exists:
[VideoListView [Component id = videoList]]
WicketMessage: Error attaching this container for rendering: [Page class =
my.package.page.VideoPage, id = 2, render count = 1]
In my VideoPage I have
public VideoPage() {
super();
videoListView = new VideoListView("videoList", new
LoadableDetachableModel<List<String>>() {
protected List<String> load() {
List<String> urls = new ArrayList<String>();
// fill list with youtube urls
// ..
return urls;
}
});
add(videoListView);
}
private class VideoListView extends ListView<String> {
public VideoListView(String name, final IModel<List<String>>
urls) {
super(name, urls);
}
protected void populateItem(ListItem<String> listItem) {
final String url = listItem.getModelObject();
final WebMarkupContainer videoFrame = new
WebMarkupContainer("videoframe");
videoFrame.add(new SimpleAttributeModifier("src", url));
// .. put other non-changing attributes here too
add(videoFrame);
}
}
and in my page I have
<div wicket:id="videoList">
<iframe wicket:id="videoframe" class="dance-video"
width="425" height="349" src="" frameborder="0" allowfullscreen></iframe>
</div>
Anyone has an idea how to achieve this ? I've also looked at InlineFrame (to
use instead of WebMarkupContainer) but it seems most concerned with
instantiating a Page to render in an iframe, if I'm correct.
thanks in advance,
kind regards
Heikki Doeleman
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/How-to-have-a-list-of-iframes-tp4080744p4080744.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]