public class TablesComponentAsXlsHandler extends Object implements org.apache.wicket.request.IRequestHandler
Request handler that respond the specified table components as a XLS file.
A possible implementation of Link
on click be:
public void onClick() {
IRequestHandler handler = new TablesComponentAsXlsHandler("fileName.xls", table1, table2);
RequestCycle.get().scheduleRequestHandlerAfterCurrent(handler);
}
Constructor and Description |
---|
TablesComponentAsXlsHandler(String filename,
org.apache.wicket.Component... tableComponents) |
Modifier and Type | Method and Description |
---|---|
void |
detach(org.apache.wicket.request.IRequestCycle requestCycle) |
protected org.apache.poi.ss.usermodel.Sheet |
newSheet(org.apache.poi.ss.usermodel.Workbook workbook,
org.apache.wicket.Component component,
int index)
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 TablesComponentAsXlsHandler(String filename, org.apache.wicket.Component... tableComponents)
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(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.wicket.Component component, int index)
Sheet
to receive the table component datapublic void setCellExporter(CellExporter cellExporter)
GeneralPurposeExporter
cellExporter
- CellExporter
Copyright © 2015. All rights reserved.