Hi Isomorphic,
I'm having trouble to upload "false" to a type="boolean" sqlStorageStrategy="singleCharYN"-ds.xml field (v10.1p_2016-03-27).
The framework seems to only recognize empty cells as "false", and not one of "N", "false", "False", "No".
supplyItem.ds.xml inStock-addition to match my configuration:
BuiltInDS.java:
See the attached CSV-file for a example.
I'd say that the correct solution would be to have uploadFieldTrueValue and uploadFieldFalseValue-attributes (or similar named) in the .ds.xml that have (like date-fields) locale-specific defaults.
Best regards
Blama
I'm having trouble to upload "false" to a type="boolean" sqlStorageStrategy="singleCharYN"-ds.xml field (v10.1p_2016-03-27).
The framework seems to only recognize empty cells as "false", and not one of "N", "false", "False", "No".
supplyItem.ds.xml inStock-addition to match my configuration:
Code:
sqlStorageStrategy="singleCharYN"
Code:
package com.smartgwt.sample.client;
import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.util.Page;
import com.smartgwt.client.util.PageKeyHandler;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.BatchUploader;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.layout.VLayout;
public class BuiltInDS implements EntryPoint {
public void onModuleLoad() {
KeyIdentifier debugKey = new KeyIdentifier();
debugKey.setCtrlKey(true);
debugKey.setKeyName("D");
Page.registerKey(debugKey, new PageKeyHandler() {
public void execute(String keyName) {
SC.showConsole();
}
});
VLayout mainLayout = new VLayout(20);
mainLayout.setWidth100();
mainLayout.setHeight100();
IButton recreateBtn = new IButton("Recreate");
recreateBtn.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
recreate();
}
});
mainLayout.addMember(recreateBtn);
recreate();
mainLayout.draw();
}
private void recreate() {
Window w = new Window();
w.setWidth("95%");
w.setHeight("95%");
w.setMembersMargin(0);
w.setModalMaskOpacity(70);
w.setTitle("Import data");
w.setShowMinimizeButton(false);
w.setIsModal(true);
w.setShowModalMask(true);
w.centerInPage();
BatchUploader batchUploader = new BatchUploader();
batchUploader.setWidth100();
batchUploader.setUploadDataSource(DataSource.get("supplyItem"));
batchUploader.setDefaultDelimiter(",");
batchUploader.setDefaultQuoteString("\"");
ListGridField itemName = new ListGridField("itemName");
ListGridField sku = new ListGridField("SKU");
ListGridField category = new ListGridField("category");
ListGridField unitCost = new ListGridField("unitCost");
ListGridField inStock = new ListGridField("inStock");
batchUploader.setGridFields(itemName, sku, category, unitCost, inStock);
w.addItem(batchUploader);
w.show();
}
}
I'd say that the correct solution would be to have uploadFieldTrueValue and uploadFieldFalseValue-attributes (or similar named) in the .ds.xml that have (like date-fields) locale-specific defaults.
Best regards
Blama
Comment