When setEditorCustomizer is not set and I click to edit the value cell, after I press the "up/down"/"Tab" key to go and start editing the cell on the previous/next record, everything work fine.
The problem comes after setEditorCustomizer is set. Now when i navigate up and down with the keyboard, the cell loses focus on the next editable cell and i have to perform another mouseclick.
In fact the setEditorCustomizer function work well because it changes the FormItem as I want, but this losing of the focus is really annoying and I need some help please!
Here is a Simple TestCase that reproduces the problem.
Try with and without the grid.setEditorCustomizer(...);
This issue is mainly in IE8,9 and maybe earlier versions of IE!
Thank you!
System:
Windows 7 64bit, GWT 2.4, SmartGwt 3, IE9
The problem comes after setEditorCustomizer is set. Now when i navigate up and down with the keyboard, the cell loses focus on the next editable cell and i have to perform another mouseclick.
In fact the setEditorCustomizer function work well because it changes the FormItem as I want, but this losing of the focus is really annoying and I need some help please!
Here is a Simple TestCase that reproduces the problem.
Try with and without the grid.setEditorCustomizer(...);
Code:
package org.testarea.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.RootPanel; import com.smartgwt.client.types.ListGridEditEvent; import com.smartgwt.client.widgets.form.fields.DateItem; import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridEditorContext; import com.smartgwt.client.widgets.grid.ListGridEditorCustomizer; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; import java.util.ArrayList; import java.util.List; public class MainEntryPoint implements EntryPoint { private ListGrid grid = new ListGrid(); public static final String FIELD_NAME = "FIELD_NAME"; public static final String FIELD_VALUE = "FIELD_VALUE"; @Override public void onModuleLoad() { grid.setWidth("100%"); grid.setHeight(500); grid.setCanEdit(Boolean.TRUE); grid.setEditEvent(ListGridEditEvent.CLICK); grid.setEditByCell(Boolean.TRUE); grid.setEditorCustomizer(new ListGridEditorCustomizer() { @Override public FormItem getEditor(ListGridEditorContext context) { ListGridField field = context.getEditField(); if (FIELD_VALUE.equals(field.getName())) { ListGridRecord record = context.getEditedRecord(); if ("name_1".equalsIgnoreCase(record.getAttribute(FIELD_NAME))) { return new DateItem(); } } return context.getDefaultProperties(); } }); ListGridField fieldNameField = new ListGridField(FIELD_NAME, "Name"); fieldNameField.setCanEdit(Boolean.FALSE); ListGridField valueField = new ListGridField(FIELD_VALUE, "Value"); grid.setFields(fieldNameField, valueField); List<ListGridRecord> recordList = new ArrayList<ListGridRecord>(); for (int i = 0; i < 6; i++) { ListGridRecord rec = new ListGridRecord(); rec.setAttribute(FIELD_NAME, "name_" + i); recordList.add(rec); } grid.setData(recordList.toArray(new ListGridRecord[]{})); RootPanel.get().add(grid); } }
Thank you!
System:
Windows 7 64bit, GWT 2.4, SmartGwt 3, IE9
Comment