Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGridField - editorType=MultiComboBoxItem

    I'm trying to use the MultiComboBoxItem as the editor for a ListGridField with multiple="true." It appears to be mostly working until I have made selections that cause the width of the buttons + the combobox to be wider than the field width after which I get errors in the development console and the UI becomes sluggish and basically unusable. I'm using an old build of 4.1p - 2014-09-18 - but was able to reproduce with the 01/29 build as well.

    Errors:
    08:48:25.876 [ERROR] [builtinds] 08:48:25.874:TMR8:WARN:HLayout:isc_HLayout_0:ignoring bad or negative left: NaN [enable 'sizing' log for stack trace]

    com.smartgwt.client.core.JsObject$SGWT_WARN: 08:48:25.874:TMR8:WARN:HLayout:isc_HLayout_0:ignoring bad or negative left: NaN [enable 'sizing' log for stack trace]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
    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:293)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Thread.java:722)

    08:49:50.844 [ERROR] [builtinds] 08:49:50.843:TMR0[E]:WARN:Canvas:Auto allocation of tab-indices has reached native browser ceiling - tab-order cannot be guaranteed for widgets on this page.

    com.smartgwt.client.core.JsObject$SGWT_WARN: 08:49:50.843:TMR0[E]:WARN:Canvas:Auto allocation of tab-indices has reached native browser ceiling - tab-order cannot be guaranteed for widgets on this page.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
    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:293)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Thread.java:722)

    I've reduced the problem to a test case:
    Code:
    public void onModuleLoad() {
        	final ListGrid grid = new ListGrid();
        	grid.setCanEdit(true);
        	ListGridField number = new ListGridField("Number");
        	ListGridField field = new ListGridField("animal");
        	field.setCanEdit(true);
        	field.setMultiple(true);
        	MultiComboBoxItem editor = new MultiComboBoxItem();
        	editor.setValueField("scientificName");
        	editor.setDisplayField("commonName");
        	editor.setOptionDataSource(DataSource.get("animals"));
        	editor.setLayoutStyle(MultiComboBoxLayoutStyle.FLOW);
        	field.setEditorProperties(editor);
        	field.setOptionDataSource(DataSource.get("animals"));
        	field.setValueField("scientificName");
        	field.setDisplayField("commonName");
        	
        	grid.setFields(number,field);
        	grid.setHeight(300);
        	grid.setWidth(500);
        	grid.setFixedRecordHeights(false);
        	Record r = new Record();
        	r.setAttribute("Number",5);
        	grid.setData(new Record[] { r});
        	grid.draw();
        }
    thanks,
    dan

    #2
    Because a MultiComboBoxItem is not a fixed-sized control, it's not expected to work as an editor in a fixed-sized grid cell.

    You could instead use a FormItemIcon to open a Window that contains a MultiComboBoxItem, or since you would have more room in a Window, a grid-based interface for searching across multiple fields and selecting multiple matching records.

    Comment


      #3
      It seems that this should work for auto-fit cells though - and it would be helpful to have the documentation updated to reflect this restriction. Unless perhaps I missed it? I've noticed similar issues with RelativeDateItem.

      I was able to work around the issue by drawing a MultiComboBoxItem on top of the cell in the EditorEnterHandler for the field. It's not perfect but should meet our needs.

      Comment


        #4
        You would really expect the cell and field to expand to accommodate the MultiComboBoxItem, pushing all the data offscreen? This is very surprising, which is why it's not something it occurred to us to document.

        Comment

        Working...
        X