You could use setResponsePage(Foo.class, PageParameters) Martijn
On Tue, Sep 8, 2009 at 12:18 PM, A. Zwaan<[email protected]> wrote: > Hello all, > > > > We are currently trying to move from wicket 1.2.6 to 1.4.1 and so far > it's going well, except for one point. > > > > In the constructor of one of our pages we use the > getBodyContainer().getBodyContainer() to add an AjaxEventBehavior for > the onload event, so we can redirect to the application if we only get > one search result on the search page. According to a colleague we did it > this way because with setResponsePage it didn't work as smoothly, > something with the page needing to be constructed first or so. > > > > Anyway, how would we go about this now? The migration guide says we > should used renderHead, but it doesn't allow me to add any Ajax stuff > from what I can see. > > > > > > Below is a part of the code: > > > > > > getBodyContainer().getBodyContainer().add(new > AjaxEventBehavior("onload") > > { > > protected void onEvent(AjaxRequestTarget target) > > { > > // open worksheet if there is only one result > and autoforward is enabled. > > if (results.size() == 1 && autoForward) > > { > > SearchViewRow document = results.get(0); > > preOpenWorksheet(document, target); > > } > > } > > > > protected IAjaxCallDecorator getAjaxCallDecorator() > > { > > return new > NotificationDecorator(ResourceBundle.getTranslation(language, > ResourceBundle.DEF_ASPECT, LabelTypes.SEARCH_LOADING)); > > } > > }); > > > > > > Hope you guys can help me out here, thanks in advance in any case. > > > > > > > > Met vriendelijke groet, > > > > Arjan Zwaan > > F I N A N F i n a n c i a l A n a l y s i s > > > Koggelaan 5-D > 8017 JH Zwolle > > ( Tel. : +31 88 77 88 990 > > 7 E-mail: [email protected] <mailto:[email protected]> > > : Internet: www.finan.nl <http://www.finan.nl/> > (Findesk BV) KvK nr. 29039392 > > > > -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
