PDA

View Full Version : Ext GWT 3.0 beta 1 - Grid & Combo Box Editing Issues



nbuesing
22 Dec 2011, 12:51 PM
I am new to GXT and looking at the 3.0 beta 1 release. In my attempt to work with a Grid with a combo box for one of the selections, I'm seeing what may be bugs (but it could very well be user error).

1. If I use GridRowEditing the changes to my combo box persist and the UI is updated (when 'save' is selected). This behaves as expected. However, if I use the GridInlineEditing, no matter what I do, the combo box reverts back to previous selection, regardless of navigating away (or hitting enter) after changing it.

Now, I'm using an enum for the value of the combo box (not a string). I am going to try to simplify my model and see if I can get things to work.

2. If I'm using the GirdRowEditing and edit the combo box, my System out below will print out to the console indefinately until I save/cancel the row editing. Is this intentional?

comboBox.setPropertEditor(new PropertyEditor<MyType>() {
@Override
public MyType parse(CharSequence text) throws java.text.ParseException {
System.out.println("parse " + text); //THIS IS LOGGING UNTIL I SAVE/CANCEL
return MyType.lookup(text.toString());
}

@Override
public String render(MyType object) {
return object == null ? MyType.UNDEFINED.toString() : object.toString();
}
});

3. I'm guessing comboBox.setPropertEditor is missing a 'y' and should be called comboBox.setPropertyEditor

All in all, I'm quite impressed with GXT 3, and really like how GXT continues to strive to be consistent with GWT (how the Grid has been refactored to be consistent with the GWT 2.x Cell tables). Also very solid beta release. I would be interested in knowing when the next beta release is going to be made available.

Thanks.

Colin Alworth
29 Dec 2011, 8:23 PM
Thanks for the feedback.

1) appears to be fixed in the latest in SVN - see http://staging.sencha.com:8080/examples-dev/#ExamplePlace:inlineeditablegrid for a nightly build, versus http://www.sencha.com/examples-dev/#ExamplePlace:inlineeditablegrid

2) I haven't looked into yet, but a few things could be at play here. Can you set a breakpoint at that line and share the stack trace as to determine where it is being called from? Running it multiple times might be good to make sure it not called from multiple places.

3) The spelling correction is in SVN, and should be available with the next beta, or from subversion.

nbuesing
30 Dec 2011, 6:48 AM
Thanks for the information, and here is the stack trace you requested. I only saw the stacktrace coming from this location (fyi: I did new RuntimeException().printStackTrace() in the code, instead of using the debugger; makes it easier to capture the text).

java.lang.RuntimeException
at com.mycompany.web.gwt.client.module.view.MyView.parse(MyView.java:493)
at com.mycompnay.web.gwt.client.module.view.Myview.parse(MyView.java:1)
at com.sencha.gxt.widget.core.client.form.ValueBaseField.getValueOrThrow(ValueBaseField.java:188)
at com.sencha.gxt.widget.core.client.form.ValueBaseField.getCurrentValue(ValueBaseField.java:94)
at com.sencha.gxt.widget.core.client.form.ValueBaseField.isCurrentValid(ValueBaseField.java:224)
at com.sencha.gxt.widget.core.client.grid.editing.GridRowEditing.isValid(GridRowEditing.java:432)
at com.sencha.gxt.widget.core.client.grid.editing.GridRowEditing.bindHandler(GridRowEditing.java:328)
at com.sencha.gxt.widget.core.client.grid.editing.GridRowEditing$3.run(GridRowEditing.java:466)
at com.google.gwt.user.client.Timer.fire(Timer.java:149)
at sun.reflect.GeneratedMethodAccessor217.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
at sun.reflect.GeneratedMethodAccessor211.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Thread.java:736)

Colin Alworth
31 Dec 2011, 11:55 AM
From reading the code in your stack trace, this is happening because GridRowEditing is polling to see if each field is presently valid. This is done to enable/disable the save button, so the user can visually tell if their changes can be saved. It appears to be a setting that can be disabled - call setMonitorValid(false) to disable this feature.

Is there a problem with it being called on a regular basis?

nbuesing
31 Dec 2011, 4:51 PM
>>Is there a problem with it being called on a regular basis?

No, the issue that I noticed was that I couldn't use keyboard navigation for changing a selection when row editing was used. It would go back to the selection. I speculated that it was related to this issue. So, if this isn't the reason that keyboard editing keeps getting overridden (by some timer that seems to be the same rate that this is being called), then I don't see it as an issue.