ValuesManager.setValues

How do I use this method? I initially tried passing it a HashMap of <String,Object> and then tried just an empty HashMap. Both result in an IllegalArgumentException.

java.lang.IllegalArgumentException: object is not an instance of declaring class
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
	at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:126)
	at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
	at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
	at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
	at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
	at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
	at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)
	at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:493)
	at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:417)
	at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvokeOnWindow(ModuleSpaceIE6.java:67)
	at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvoke(ModuleSpaceIE6.java:152)
	at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:447)
	at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:248)
	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
	at com.smartgwt.client.core.BaseClass.setProperty(BaseClass.java)
	at com.smartgwt.client.core.BaseClass.setAttribute(BaseClass.java:253)
	at com.smartgwt.client.widgets.form.ValuesManager.setValues(ValuesManager.java:336)

Could you show the rest of your code? Ideally, a test case that can be run standalone.

There was a basic bug in the last build. This has been fixed and the change will be in the next build.

Sanjiv

Great, I’ll try it out once the next build is up.

For reference, this was the relevant portion of my code.

I created a ValuesManager during the form creation and set it on the form.

siteSearchForm = createForm();
siteValuesManager = new ValuesManager();
siteSearchForm.setValuesManager(siteValuesManager);

I was using a ListGrid that contained a number of value objects. On a double click event, I was attempting to set values on the ValuesManager in order to update the form fields. My application will need multiple forms, which is why I was trying out the ValuesManager class.

public void onCellDoubleClick(CellDoubleClickEvent event)
{
    SiteListGridRecord record = (SiteListGridRecord) event.getRecord();        			
    SiteVO vo = record.getSiteVO();
        			        			
    Map values = new HashMap();
    //values.put("name", vo.getName());
    //values.put("type", vo.getType());
        			
    siteValuesManager.setValues(values);
    ...
}

Fix is in SVN.

Build instructions for building from SVN can be found here

http://code.google.com/p/smartgwt/wiki/BuildingFromSVN

A ValuesManager.getValues() method would be very useful. There are times when using getValueAsString is not always convenient.