>> can you think of an alternative for setting the page to null?
>> Like an indicator (comparable to the redirect property), that the page
>> should not be rendered (further)?
Possible solutions and there impact:
1) The following snippet is part of a Page with an export Link.
Page.handleRender() is subclassed and depending on a MyPage variable,
MyPage is rendered (normal case) or not (response contains exported
data). It works, I tried it.
Pro:
we have a solution. Not very elegant, but it works
Cons:
No generell solution (for a rare case. Do we need a generell
solution for a rare case?)
Possible problems with BasePage to be developed sometime in the future.
// Add the export links
add(new Link("exportCsv")
{
public void linkClicked(final RequestCycle cycle)
{
new Export().doExport(cycle, new CsvView(data, true,
false, false), data);
renderPage = false;
}
});
add(new ExportLink("exportExcel", data, new ExcelView(data,
true, false, false)));
add(new ExportLink("exportXml", data, new XmlView(data, true,
false, false)));
}
protected void handleRender(RequestCycle cycle)
{
if (this.renderPage == true)
{
super.handleRender(cycle);
}
}
2) Same as 1) but with a Page variable, not MyPage.
Pro: generell solution
Con:
Increases Pages memory footprint (Session memory, clustering, ..)
3) Introduce a dontRenderPage(boolean) with RequestCycle. If true,
don't call page.render().
Pro: generell solution which does not interfere with BasePage
classes etc. and cheap to implement.
4) Don't provide generic solution because there are not many cases
known where this feature is needed. Instead explain to users how a
workaround might look like (see above)
I'm currently preferring 3)
regards
Juergen
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Wicket-develop mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/wicket-develop