public class TableComponentAsXlsHandler extends Object implements org.apache.wicket.request.IRequestHandler
Request handler that respond the specified table component as a XLS file.
An possible Link
onClick method implementation seting this handler could be:
public void onClick() {
IRequestHandler handler = new TableComponentAsXlsHandler( table, "fileName.xls");
RequestCycle.get().scheduleRequestHandlerAfterCurrent(handler);
}
Constructor and Description |
---|
TableComponentAsXlsHandler(org.apache.wicket.Component tableComponent,
String filename) |
Modifier and Type | Method and Description |
---|---|
void |
detach(org.apache.wicket.request.IRequestCycle requestCycle) |
protected org.apache.poi.ss.usermodel.Sheet |
newSheet()
Create the sheet in where component table data will be set
|
void |
respond(org.apache.wicket.request.IRequestCycle requestCycle) |
void |
setCellExporter(CellExporter cellExporter)
Set the exporter strategy to be used by this handler.
|
public TableComponentAsXlsHandler(org.apache.wicket.Component tableComponent, String filename)
tableComponent
- filename
- public void respond(org.apache.wicket.request.IRequestCycle requestCycle)
respond
in interface org.apache.wicket.request.IRequestHandler
public void detach(org.apache.wicket.request.IRequestCycle requestCycle)
detach
in interface org.apache.wicket.request.IRequestHandler
protected org.apache.poi.ss.usermodel.Sheet newSheet()
Sheet
to receive the table component datapublic void setCellExporter(CellExporter cellExporter)
GeneralPurposeExporter
cellExporter
- CellExporter
Copyright © 2015. All rights reserved.