I am trying to support Unicode characters in my forms, but this is only working for some characters.
I discovered that the problem is the MSSQL DB I am using.
If I update the field using:
update t_schueler set f_field = 'ě'
the character is converted to 'e'. So that is why SmartGWT shows me an 'e' when updating this field (instead of 'ě').
If I update the field using:
update t_schueler set f_field = N'ě'
(note the "N"), then the field is saved correctly and smartgwt also shows the correct value.
But the problem is I need a smartGWT DynamicForm to update the values. How to get SmartGWT to use the "N" variant when saving the DynamicForm? Or something similar?
If this is not possible, how to save the value 'ě' using a DynamicForm?
In order to test, here is my testcase: (it is only a dynamicForm which adds values to the table). If you type ě, and push "Add", you will see that it is converted to e.
Using smartGWT 4.1p 2014-09-06 and MSSQL 2014. The field "f_name" is of type nvarchar.
I discovered that the problem is the MSSQL DB I am using.
If I update the field using:
update t_schueler set f_field = 'ě'
the character is converted to 'e'. So that is why SmartGWT shows me an 'e' when updating this field (instead of 'ě').
If I update the field using:
update t_schueler set f_field = N'ě'
(note the "N"), then the field is saved correctly and smartgwt also shows the correct value.
But the problem is I need a smartGWT DynamicForm to update the values. How to get SmartGWT to use the "N" variant when saving the DynamicForm? Or something similar?
If this is not possible, how to save the value 'ě' using a DynamicForm?
In order to test, here is my testcase: (it is only a dynamicForm which adds values to the table). If you type ě, and push "Add", you will see that it is converted to e.
Code:
public class BuiltInDS implements EntryPoint { ListGrid lg = new ListGrid(); public void onModuleLoad() { final DynamicForm singleFieldForm = new DynamicForm(); TextItem formItem = new TextItem("f_name", "Name"); singleFieldForm.setFields(formItem); singleFieldForm.setDataSource(DataSource.get("table")); VLayout vlayout = new VLayout(); vlayout.setHeight100(); vlayout.setWidth100(); vlayout.addMember(singleFieldForm); final IButton button = new IButton("Add"); button.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { singleFieldForm.saveData(new DSCallback() { @Override public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) { SC.say("Correctly saved"); } }); } }); ListGrid lg = new ListGrid(); ListGridField idField = new ListGridField("f_schueler_id"); idField.setHidden(true); ListGridField nameField = new ListGridField("f_name", "Name"); lg.setFields(nameField); lg.setHeight100(); lg.setWidth100(); lg.setDataSource(DataSource.get("table")); lg.setAutoFetchData(true); lg.setSortField("f_name"); vlayout.addMember(button); vlayout.addMember(lg); vlayout.draw(); }
Code:
<DataSource ID="table" serverType="sql" tableName="t_schueler" > <fields> <field name="f_schueler_id" type="sequence" primaryKey="true" /> <field name="f_name" type="text" required="true" /> </fields> </DataSource>
Comment