listgrid warnings

Since my last SVN update I get:

14:44:19.406:TMR6:WARN:ListGrid:isc_OID_200:getFilterEditorValues gave:{id: undef,
name: undef,
color: undef,
calendar: undef}

(in a three-column listgrid obviously), when I create a listgrid, can you point me to the right direction for fixing this warning? (or should I ignore it maybe)

Another thing, ListGrid.startEditingNew(); doesn’t work anymore (I don’t get a new empty record) instead I get:

14:47:08.736:MUP4:WARN:Log:TypeError: _2 is undefined

Again, any help will be grately appreciated

Bas

Here is a simple test application showing the not-working ListGrid.startEditingNew(); call:

package test.client;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.types.Autofit;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.layout.VLayout;

public class Application implements EntryPoint
	{
	 private final String[] countryRecords = new String[]
	        { "countryCode;countryName;capital",
	          "US;United States;Washington, DC",
	          "CH;China;Beijing",
	          "JA;Japan;Tokyo",
	          "IN;India;New Delhi",
	          "GM;Germany;Berlin",
	        };
	     
	private ListGridRecord[] createListGridRecords(String[] records)
		{
		ListGridRecord[] result = new ListGridRecord[records.length - 1];
		String[] fieldNames = records[0].split(";");
		for (int recordIndex = 1; recordIndex < records.length; ++recordIndex)
			{
			String[] fieldValues = records[recordIndex].split(";");
			result[recordIndex - 1] = new ListGridRecord();
			for (int fieldIndex = 0; fieldIndex < fieldValues.length; ++fieldIndex)
				{
				result[recordIndex - 1].setAttribute(fieldNames[fieldIndex], fieldValues[fieldIndex]);
				}
			}
		return result;
		} 
	
	public void onModuleLoad()
		{
		SC.showConsole();
		
		final VLayout vlayout = new VLayout();
		
		final ListGrid myListGrid = new ListGrid();
		myListGrid.setData(createListGridRecords(countryRecords));
		myListGrid.setAutoFitData(Autofit.BOTH);
		myListGrid.setCanEdit(true);
		
		ListGridField countryCodeField = new ListGridField("countryCode", "Code", 100);
		ListGridField countryNameField = new ListGridField("countryName", "Name", 200);
		ListGridField countryCapitalField = new ListGridField("capital", "Capital", 200);
		
		myListGrid.setFields(countryCodeField, countryNameField, countryCapitalField);
		
		vlayout.addMember(myListGrid);
		
	    final IButton newButton = new IButton("new");
		newButton.addClickHandler(new ClickHandler()
			{
			public void onClick(ClickEvent event)
				{
				myListGrid.startEditingNew();
				}
			});  
		vlayout.addMember(newButton);
		
		vlayout.draw();
		}

	}

Thanks Kinglear, both bugs have been whacked and will hit SVN shortly.

Woooo! quick as allways, thanks!

Bas

Updates added to SVN.

Sanjiv

Thanks again, confirmed, the warning with ListGrid.startEditingNew(); is gone.

The warning when showing a filterEditor stays, here is a simple app showing this behavior:

package test.client;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.types.Autofit;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;

public class Application implements EntryPoint
	{
	 private final String[] countryRecords = new String[]
	        { "countryCode;countryName;capital",
	          "US;United States;Washington, DC",
	          "CH;China;Beijing",
	          "JA;Japan;Tokyo",
	          "IN;India;New Delhi",
	          "GM;Germany;Berlin",
	        };
	     
	private ListGridRecord[] createListGridRecords(String[] records)
		{
		ListGridRecord[] result = new ListGridRecord[records.length - 1];
		String[] fieldNames = records[0].split(";");
		for (int recordIndex = 1; recordIndex < records.length; ++recordIndex)
			{
			String[] fieldValues = records[recordIndex].split(";");
			result[recordIndex - 1] = new ListGridRecord();
			for (int fieldIndex = 0; fieldIndex < fieldValues.length; ++fieldIndex)
				{
				result[recordIndex - 1].setAttribute(fieldNames[fieldIndex], fieldValues[fieldIndex]);
				}
			}
		return result;
		} 
	
	public void onModuleLoad()
		{
		SC.showConsole();
		ListGrid myListGrid = new ListGrid();
		myListGrid.setData(createListGridRecords(countryRecords));
		myListGrid.setAutoFitData(Autofit.BOTH);
		myListGrid.setShowFilterEditor(true);
		
		ListGridField countryCodeField = new ListGridField("countryCode", "Code", 100);
		ListGridField countryNameField = new ListGridField("countryName", "Name", 200);
		ListGridField countryCapField = new ListGridField("capital", "Capital", 200);
	
		myListGrid.setFields(countryCodeField, countryNameField, countryCapField);  
		myListGrid.draw();
		}
	}

This warning is showed:

11:26:55.581:WARN:ListGrid:isc_OID_0:getFilterEditorValues gave:{countryCode: undef,
countryName: undef,
capital: undef}

Hi Bas,
You can safely ignore these warnings. And we’ve really fixed them in mainline now!
Thanks
Isomorphic Software