Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
475
CSV Export
posted

Hi,

 I see an example for exporting grid data to CSV (EXCEL) file. But I don't see the corresponding example for backing bean code. Can someone provides that? Thanks.

Parents
No Data
Reply
  • 1045
    Offline posted

    Hi Yzbythesea,

    The following code sample shows how to export your current page:

    JSP

    <h:commandButton
    value="Download"
    actionListener="#{exportGrid.csvDownload}"
    />

    Java

    public void csvDownload(ActionEvent event)
    {
    getGrid().export(DataToExport.CURRENT, ExportFormat.CSV);
    FacesContext context = FacesContext.getCurrentInstance();
    context.responseComplete();
    }

    For more examples, please take a look at the following website NetAdvantage for JSF

    Regards,

    Pamela

     

Children