1. SmartGWT 2.5
2. Developer Console - SmartClient Version: SC_SNAPSHOT-2011-07-12/Pro Deployment (built 2011-07-12)
3. Error Transport error - HTTP code: 0 for URL: /pc2/sc/IDACall?sessionToken
4. Code sample
Button downLoadButton = new Button();
downLoadButton.setTitle("Download");
downLoadButton.addClickHandler(
new ClickHandler(){
@Override
public void onClick(ClickEvent event) {
String status = StatusRadioGroup.getValueAsString();
//several attempts made with ListGrid.clearCriteria();
if(status.equalsIgnoreCase("NOCRITERIA")){
System.out.println("Search Criteria only for download");
}
else {
ListGrid.clearCriteria();
Criteria downloadCriteria = new Criteria();
if(status.equalsIgnoreCase("ALL")){
//ListGrid.invalidateCache();
downloadCriteria.addCriteria("STATUS", Status.NEW.toString());
downloadCriteria.addCriteria("STATUS", Status.OLD.toString());
}
if(status.equalsIgnoreCase("OLD")){
downloadCriteria.addCriteria("STATUS", Status.OLD.toString());
}
if(status.equalsIgnoreCase("NEW")){
downloadCriteria.addCriteria("STATUS", Status.NEW.toString());
}
//Several attempts made commenting out invalidateCache/clearCriteria
ListGrid.invalidateCache();
ListGrid.setCriteria(downloadCriteria);
ListGrid.fetchData(downloadCriteria);
}
DSRequest dsRequestProperties = new DSRequest();
String fileFormat = fileFormatRG.getValueAsString();
if(fileFormat.equalsIgnoreCase("CSV")){
dsRequestProperties.setExportAs(ExportFormat.CSV);
}
if(fileFormat.equalsIgnoreCase("EXCEL")){
dsRequestProperties.setExportAs(ExportFormat.XLS);
}
dsRequestProperties.setDataSource("product_DS");
dsRequestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);
dsRequestProperties.setExportFilename("Products-" + statusRG.getValueAsString());
// attempts made using this finction instead of exportClientData
//ListGrid.exportData(dsRequestProperties);
ListGrid.exportClientData(dsRequestProperties);
}
}
);
2. Developer Console - SmartClient Version: SC_SNAPSHOT-2011-07-12/Pro Deployment (built 2011-07-12)
3. Error Transport error - HTTP code: 0 for URL: /pc2/sc/IDACall?sessionToken
4. Code sample
Button downLoadButton = new Button();
downLoadButton.setTitle("Download");
downLoadButton.addClickHandler(
new ClickHandler(){
@Override
public void onClick(ClickEvent event) {
String status = StatusRadioGroup.getValueAsString();
//several attempts made with ListGrid.clearCriteria();
if(status.equalsIgnoreCase("NOCRITERIA")){
System.out.println("Search Criteria only for download");
}
else {
ListGrid.clearCriteria();
Criteria downloadCriteria = new Criteria();
if(status.equalsIgnoreCase("ALL")){
//ListGrid.invalidateCache();
downloadCriteria.addCriteria("STATUS", Status.NEW.toString());
downloadCriteria.addCriteria("STATUS", Status.OLD.toString());
}
if(status.equalsIgnoreCase("OLD")){
downloadCriteria.addCriteria("STATUS", Status.OLD.toString());
}
if(status.equalsIgnoreCase("NEW")){
downloadCriteria.addCriteria("STATUS", Status.NEW.toString());
}
//Several attempts made commenting out invalidateCache/clearCriteria
ListGrid.invalidateCache();
ListGrid.setCriteria(downloadCriteria);
ListGrid.fetchData(downloadCriteria);
}
DSRequest dsRequestProperties = new DSRequest();
String fileFormat = fileFormatRG.getValueAsString();
if(fileFormat.equalsIgnoreCase("CSV")){
dsRequestProperties.setExportAs(ExportFormat.CSV);
}
if(fileFormat.equalsIgnoreCase("EXCEL")){
dsRequestProperties.setExportAs(ExportFormat.XLS);
}
dsRequestProperties.setDataSource("product_DS");
dsRequestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);
dsRequestProperties.setExportFilename("Products-" + statusRG.getValueAsString());
// attempts made using this finction instead of exportClientData
//ListGrid.exportData(dsRequestProperties);
ListGrid.exportClientData(dsRequestProperties);
}
}
);
Comment