Hi!
We're facing the following issue:
When positioning the cursor on the last position, the cursor jumps to the first position. We're seeing this on IE9 using the latest 3.1 nightly build.
Repro case:
1. Run the EntryPoint below
2. Type in some text in TextItem no1.
3. Type in some text in TextItem no2.
4. Click with the mouse on TextItem no1.
-> Cursor jumps from last position to the first position
Thx!
We're facing the following issue:
When positioning the cursor on the last position, the cursor jumps to the first position. We're seeing this on IE9 using the latest 3.1 nightly build.
Repro case:
1. Run the EntryPoint below
2. Type in some text in TextItem no1.
3. Type in some text in TextItem no2.
4. Click with the mouse on TextItem no1.
-> Cursor jumps from last position to the first position
Code:
public class StandaloneTestcase implements EntryPoint {
public void onModuleLoad() {
DynamicForm form = new DynamicForm();
form.setWidth(400);
form.setSelectOnFocus(true);
TextItem textItem1 = new TextItem();
textItem1.setName("textItem1");
textItem1.setTitle("TextItem no 1");
textItem1.setFormatOnFocusChange(true); //setFormatOnFocusChange !
textItem1.setEditorValueFormatter(formItemValueFormatter);
TextItem textItem2 = new TextItem();
textItem2.setName("textItem2");
textItem2.setTitle("TextItem no 2");
form.setFields(textItem1, textItem2);
form.draw();
}
private FormItemValueFormatter formItemValueFormatter = new FormItemValueFormatter() {
public String formatValue(Object value, Record record, DynamicForm form, FormItem item) {
if (value == null)
return "";
// form.getFocusItem(); not reliable, as documentation states
if (hasFocus(item)) {
return value.toString();
} else {
return "(no focus) " + value.toString();
}
}
};
public static native boolean hasFocus(FormItem item) /*-{
var self = item.@com.smartgwt.client.core.DataClass::getJsObj()();
if (self && self.hasFocus != null) {
return self.hasFocus;
}
return false;
}-*/;
}
Thx!
Comment