Announcement

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

    Problem with ListGridEditorCustomizer and SelectOtherItem

    When using a SelectOtherItem in the new awesome ListGridEditorCustomizer something strange happens: When you open the item at first and select a value (that is not "Other") and then try to select a second time: the SelectOtherItem fetches on the datasource of the grid. So in this case suddenly the SelectOtherItem contains all the content records.

    This was tested on SmartGWT Power 2.5, GWT 2.1.0 and Internet explorer 9

    Code:
    package test.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.widgets.form.fields.FormItem;
    import com.smartgwt.client.widgets.form.fields.SelectOtherItem;
    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.layout.HLayout;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    /**
     * Entry point classes define <code>onModuleLoad()</code>.
     */
    public class Test implements EntryPoint {
    
    	private VLayout vlayout = new VLayout();
    	private HLayout hlayout = new HLayout();
    	private ListGrid listGrid = new ListGrid();
    
    	public void onModuleLoad() {		
    		vlayout.setWidth100();
    		vlayout.setHeight100();
    		
    		listGrid.setDataSource(DataSource.get("Content"));
    		listGrid.setAutoFetchData(true);
    		listGrid.setCanEdit(true);
    		
    		listGrid.setEditorCustomizer(new ListGridEditorCustomizer() {
    			
    			@Override
    			public FormItem getEditor(ListGridEditorContext context) {
    				SelectOtherItem selectOtherItem = new SelectOtherItem();
    				selectOtherItem.setValueMap("1", "two", "III"); 
    				selectOtherItem.setEmptyDisplayValue("Choose value");
    				return selectOtherItem;
    			}
    		});
    		
    		
    		hlayout.addMember(listGrid);
    		vlayout.addMember(hlayout);		
    		vlayout.draw();
    	}
    }
    Code:
    <DataSource
    	ID="Content"
    	tableName="Content"
    	serverType="sql"
    >
    	<fields>
    		<field name="cntn_pk" type="sequence" primaryKey="true"/>
    		<field name="cntn_id" title="Id" type="text"/>	
    	</fields>
    </DataSource>

    #2
    Hi, Im still seeing this in the latest 2.5.x nightly of the Power edition. Any chance you could take a look at this?

    Comment


      #3
      Are you still experiencing this problem? I've tried to reproduce it and did not succeed. I used same code, same versions and environment, could you provide more details if possible?

      Comment

      Working...
      X