Hello, I do something similar in a page constructor, even with accessing the service layer. I have the same concerns, if this is correct. In general I do not like if a constructor does any significant (eventually time consuming) work like database access or other. But I did not find an other solution neither. Maybe it could be "postponed" by using a model which executes the needed calls to the service layer in an lazy fashion.
Carsten Jonas505 wrote: > > Thank you for the quick reply. > > It's already working fine, I was just wondering if it is best practice to > call business logik from the constructor: > > public PageB(PageParameters p) { > // can throw an exception: > DataSet result = callMyBusinessLogik(p.getString("param1"), > p.getString("param2")); > preparePageBComponents(result); > } > > Jonas > > From: Martijn Dashorst > 14 Jan 2009 14:24:21 +0100 > Subject: Re: Where to process PageParameters > >> setResponsePage(PageB.class, parameters); >> >> or use a bookmarkablepagelink >> >> Martijn >> >> On Wed, Jan 14, 2009 at 1:06 PM, Jonas505 <jonas.hoepf...@iteratec.de> >> wrote: >> > >> > Hello, >> > >> > I would like to know, where in my WebPage class PageParameters should >> be >> > processed. >> > >> > I have a page A where you can fill in certain parameters (or select a >> > predefined set of parameters). Then you submit those parameters which >> are >> > given to the business logic to prepare some data. The resulting data is >> > shown on page B. I would like that the user can bookmark page B with >> those >> > parameters encoded in the URL. >> > >> > This works fine with page B having a constructor taking PageParameters. >> > However, right now I call the Business-Logik from the constructor of >> page >> B, >> > which seems strange. Am I missing something or is this the way to go? >> > >> > Thank you! >> > Jonas >> > -- >> > View this message in context: >> http://www.nabble.com/Where-to-process-PageParameters-tp21454742p21454742.html >> > Sent from the Wicket - User mailing list archive at Nabble.com. >> > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> > For additional commands, e-mail: users-h...@wicket.apache.org >> > >> > >> >> >> >> -- >> Become a Wicket expert, learn from the best: http://wicketinaction.com >> Apache Wicket 1.3.5 is released >> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/Where-to-process-PageParameters-tp21454742p21460425.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org