I wanna make the items of list view, that is, table cells, clickable so that they will send to another page. Could anyone let me know what's my problem here ? Thanks in advance.
That's the html : http://pastebin.com/qUaPzTwv
That's what i'm trying
Application app = (Application) getApplication();
MovieCollection col = app.getCollection();
List<Movie> movies = col.getMovies();
add(new ListView("movie_list", movies) {
@Override
protected void populateItem(ListItem item) {
final Movie movie = (Movie) item.getModelObject();
item.add(new Label("title", movie.getTitle()));
item.add(new Label("year", Integer.toString(movie.getYear())));
item.add(new Link("movie_link") {
@Override
public void onClick() {
setResponsePage(new MoviePage(movie));
}
});
}
});
And that's the output :
Last cause: Unable to find component with id 'title' in [ [Component id = movie_link]]
Expected: 'movie_list:0:movie_link.title'.
Found with similar names: 'movie_list:0:title', movie_list:1:title', movie_list:2:title'