setExportFieldTitles() seems not to work. I still get the "name" title in the excel file, while I should get "name abc abc".
This was working in previous versions.
Using smartgwt 6.0p 06.04.16 power.
schueler_table.ds.xml:
TestingDMI:
This was working in previous versions.
Using smartgwt 6.0p 06.04.16 power.
Code:
public void onModuleLoad() {
final VLayout vlayout = new VLayout();
final ListGrid lg = new ListGrid();
ListGridField nameField = new ListGridField("f_name", "name");
lg.setFields(nameField);
lg.setDataSource("schueler_table");
lg.fetchData();
IButton but = new IButton("click me");
but.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
DSRequest properties = new DSRequest();
properties.setExportFilename("Export");
properties.setExportAs(ExportFormat.XLS);
properties.setOperationId("fetch_test");
properties.setExportDisplay(ExportDisplay.DOWNLOAD);
lg.exportData(properties);
}
});
vlayout.addMember(lg);
vlayout.addMember(but);
vlayout.setWidth100();
vlayout.setHeight100();
vlayout.draw();
}
Code:
<DataSource ID="schueler_table">
<fields>
<field name="f_name" type="text" />
</fields>
<operationBindings>
<operationBinding operationType="fetch" operationId="fetch_test">
<serverObject className="de.mks_infofabrik.kids.server.test.TestingDMI"
methodName="testMethod" />
</operationBinding>
</operationBindings>
</DataSource>
Code:
public class TestingDMI {
private static final Logger LOG = Utils.getLogger(TestingDMI.class);
public DSResponse testMethod(DSRequest dsRequest) throws Exception {
LOG.info("TestingDMI: ExecuteMethod()");
Map<String,Object> originalTitles = dsRequest.getExportFieldTitles();
originalTitles.put("f_name", "name abc abc");
dsRequest.setExportFieldTitles(originalTitles);
return dsRequest.execute();
}
}
Comment