Dzenan Ridjanovic wrote:
Could you give us the stracktrace you got?
I have changed the code this afternoon and could not reproduce the error.
However, I have done something similar and it works:
public class UrlsPage extends WebPage ...
public UrlsPage(PageParameters pageParameters) {
UrlsApp app = (UrlsApp)getApplication(); Urls urls = (Urls)
pageParameters.get("categoryUrls");
Please be carefull. PageParameters are meant for bookmarkable pages.
So there should be only Strings (or things like Integers that have a
simple string presentation)
So if you use this page also as a bookmarkable page then that Urls cast
will throw a classcast or will return null...!!
...
public final void onSubmit() { String enteredCategory =
category.getInput();
if (enteredCategory != null) {
RequestCycle cycle = getRequestCycle();
PageParameters parameters = new PageParameters();
UrlsApp app = (UrlsApp)getApplication();
Urls urls = app.getUrlsDb().getCategoryUrls(enteredCategory);
parameters.put("category", enteredCategory);
parameters.put("categoryUrls", urls);
cycle.setResponsePage(getPageFactory().newPage(UrlsPage.class,
parameters));
cycle.setRedirect(true);
}
}
You are really mis using PageParameters
you just should do:
cycle.setResponsePage(new UrlsPage(urls));
much simpler.
johan
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user