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");
String enteredCategory = pageParameters.getString("category");
if (enteredCategory == null) {
urls = app.getUrlsDb().getUrls();
createUrlsPageComponents(urls, "None");
}
else {
createUrlsPageComponents(urls, enteredCategory);
}
}
...
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);
}
}
In onSubmit, I put my POJO in parameters:
parameters.put("categoryUrls", urls);
In the constructor, I get my POJO:
Urls urls = (Urls) pageParameters.get("categoryUrls");
This is great!
Finally, I may ignore the HTTP details (when I do not need them) such as all
parameters are text, etc.
Thanks,
Dzenan
-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user