Hello,
I have a question:
Suppose I have a detachable model which loads master instances (say
leagues entities using hibernate)
add( new ListView( "leagues", new UserLeaguesModel( this.leagueService ) ) {
@Override
protected void populateItem( ListItem listitem ) {
League league = (League) listitem.getModelObject();
listitem.add( new Link( "leagueLink" ) {
@Override
public void onClick() {
System.out.println( "link clicked" );
}
}.add( new Label( "leagueName", league.getName() ) ) );
listitem.add( new ListView( "matches", new
LeagueLastMatchesModel( leagueService, league, 10 ) ) {
@Override
protected void populateItem( ListItem newsItem ) {
// populate match info here
}
} );
}
} );
Both UserLeaguesModel and LeagueMastMatchesModel are the instances of
LoadableDetachableModel. What bothers me here is the fact that I need to
create the dependent model with 'league' parameter (which might be
large so I do not want to keep it attached).
I do not want to pass league.id only as my whole business layer is
strongly typed and uses entities as parameters.
Questions:
- does it change anything if I passed listItem.getModel() ?
- if the former is also not a good idea how can I assure full
detachability (means no League object gets serialized to session)?
--
Leszek Gawron
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user