Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • ListGrid.exportClientData(dsRequest) error when grid is grouped


    Version: v9.1p_2018-01-07/PowerEdition Deployment (built 2018-01-07)

    Error: com.google.gwt.core.shared.SerializableThrowable: Exception caught: (TypeError) __gwt$exception: <skipped>: Cannot read property 'getOrCreateJsObj__Lcom_google_gwt_core_client_JavaScriptObject_2' of null

    Code:
    protected ListGrid mGrid;
    
    private ClickHandler getExportToFileHandler() {
    ClickHandler clickHandler = new ClickHandler() {
    public void onClick(ClickEvent event) {
    exportToFile(ExportTool.getExportProperties());
    }
    };
    return clickHandler;
    }
    
    protected void exportToFile(final DSRequest dsRequestProperties) {
    final ResultSet resultSet = mGrid.getResultSet();
    resultSet.getRange(0, resultSet.getLength());
    
    mHandler = resultSet.addDataArrivedHandler(new com.smartgwt.client.data.events.DataArrivedHandler() {
    @Override
    public void onDataArrived(com.smartgwt.client.data.events.DataArrivedEvent dataArrivedEvent) {
    mGrid.exportClientData(dsRequestProperties);
    removeHandler();
    }
    });
    mGrid.getResultSet().getRange(0, mGrid.getResultSet().getLength());
    }
    
    public class ExportTool {
    
    public static DSRequest getExportProperties(){
    DSRequest dsRequestProperties = new DSRequest();
    dsRequestProperties.setExportAs((ExportFormat)EnumUtil.getEnum(ExportFormat.values(), "ooxml"));
    dsRequestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);
    return dsRequestProperties;
    }
    }
    Last edited by anderfim; 12th Apr 2018, 22:27.

  • #2
    I'll fix the formatting :p

    Comment


    • #3
      Please see the FAQ for how to report issues: we need to be able to reproduce the issue, and this code is neither complete nor runnable.

      You also neglected to report the stack trace for the JS error, which is also always required.

      Comment


      • #4
        I am sorry about the bad reporting. I found the answer my self, and I will give a better description and so on next time.

        Comment

        Working...
        X