If loading data prematurely is a concern, then you should use models that lazy-load objects and lists. There is no requirement that the data should be fetched prior to rendering.
It is an antipattern to construct pages before hand and not doing anything with them, as your example of PageLink usage: the PageLink should not be used in that way, and therefore has been moved to extensions to limit its visibility. Pages should also be lazily created, since there are other forces (for example page maps) at work that will possibly be affected by it. Martijn On 5/7/07, Jeremy Thomerson <[EMAIL PROTECTED]> wrote: > All the examples seem to show components (Labels, custom components, > ListViews, Tables, etc) added to the page in the constructor. Is this > really the best place to add the components to the page? Or should you just > be setting up the model for the page in the constructor, and at a > later-pre-render time you construct the actual components that go in the > page? > > My concern is that there are times that a page might be constructed but not > rendered. I'm not 100% sure this is the case, but it could easily be a > mistake by ones new to the framework that might be avoided by having a > separate place for component initialization. For instance, you might > construct a page for a PageLink, and you pass to the page constructor a > category. Then, to initialize a ListView of widgets that appear under that > category, the constructor loads stuff from the database. I suppose that the > constructor shouldn't load things, but rather be using a loadable model, but > newcomers might not know this. So, on a page, you construct the pages to > use in pagelinks, and you're doing a lot of unnecessary object construction, > and perhaps loading of database objects. Or, you have to use > BookmarkablePageLinks and PageParameters for everything. > > Thoughts? > > Thank you, > Jeremy Thomerson > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Wicket-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/wicket-user > > -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.6 contains a very important fix. Download Wicket now! http://wicketframework.org ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
