Datasource field of type boolean with canEdit=false is nicely rendered in the ListGrid, however it is not when used on DynamicForm.
Both are fine when canEdit=true.
canEdit = true
canEdit = false
Would it be corrected soon ? Any workaround suggestions ?
Tnanks,
MichalG
ps
SmartGWT svn 1307, GWT-2.0.3
Both are fine when canEdit=true.
canEdit = true
canEdit = false
Code:
package org.yournamehere.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.RootPanel; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.fields.DataSourceBooleanField; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.layout.VLayout; public class MainEntryPoint implements EntryPoint { public MainEntryPoint() { } public void onModuleLoad() { RootPanel.get().add(getCanvas()); } public Canvas getCanvas() { VLayout layout = new VLayout(); DataSource ds = new DataSource(); ds.setClientOnly(true); DataSourceBooleanField booleanField = new DataSourceBooleanField("yesno"); booleanField.setCanEdit(false); ds.addField(booleanField); ListGridRecord[] records = new ListGridRecord[1]; records[0] = new ListGridRecord(); records[0].setAttribute("yesno", true); ListGrid list = new ListGrid(); list.setDataSource(ds); list.setData(records); list.selectRecord(0); DynamicForm form = new DynamicForm(); form.setDataSource(ds); form.editSelectedData(list); layout.addMember(list); layout.addMember(form); return layout; } }
Tnanks,
MichalG
ps
SmartGWT svn 1307, GWT-2.0.3
Comment