Warning when set sort on selectitem

hi,

I am using setSortField(str) for an SelectItem, the UI looks fine, but there are always warnings:

“WARN:PickListMenu:isc_PickListMenu_0:fields and completeFields are null and there is no DataSource”

If I don’t use the function setSortField(str), no any warning, can somebody help me for that?

The following is the code:

public void onModuleLoad() {
		DataSourceField[] fields = new DataSourceField[2];
		DataSource ds = new DataSource();
		SelectItem comboBox = new SelectItem("f1", "F1");
		DynamicForm comboBoxForm = new DynamicForm();
		int recNum = 20;
		
		fields[0] = new DataSourceField();
		fields[0].setType(FieldType.TEXT);
		fields[0].setPrimaryKey(true);
		fields[0].setName("f1");
		fields[1] = new DataSourceField();
		fields[1].setType(FieldType.TEXT);
		fields[1].setName("display");

		ds.setID("ds");
		ds.setFields(fields);
		ds.setClientOnly(true);
		
		comboBox.setPickListWidth(210);  
		comboBox.setOptionDataSource(ds);
		comboBox.setValueField("f1");
		comboBox.setDisplayField("display");
		comboBox.setSortField("display");
		
		
		comboBoxForm.setItems(comboBox);
		
		Record[] records = new Record[recNum];
		for(int i=0; i<recNum; i++) {
			records[i] = new Record();
			records[i].setAttribute("f1", "r"+i);
			records[i].setAttribute("display", "display"+(recNum-i));
			ds.addData(records[i]);
		}
		
		comboBoxForm.draw();
	}

Hello,

Using GWT 2.4 with Smart GWT 3.0, on a windows 7 machine using Firefox 7. In debug development mode in eclipse indigo and at the last step in my entrypoint function on the draw I get a error (below).

Think it has something to do with my Smart GWT combobox usage …
Datasource I am using is MySQL, which is online. When the UI comes up it works fine and the error is not a problem. Not sure what to make of the error.

Here is the message I get

11:31:25.795 [ERROR] [winter] 11:31:25.766:WARN:PickListMenu:isc_PickListMenu_0:fields and completeFields are null and there is no DataSource
com.smartgwt.client.core.JsObject$SGWT_WARN: 11:31:25.766:WARN:PickListMenu:isc_PickListMenu_0:fields and completeFields are null and there is no DataSource
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
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.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.invokeNativeVoid(ModuleSpace.java:289)

Hi evansmith1 and ql20080101,

I have the same problem, see http://forums.smartclient.com/showthread.php?t=21670 and http://forums.smartclient.com/showthread.php?t=20811 for it.

I have no idea so far how to solve it or what causes it. If you find out, please let me know.

Thanks,
Blama

Same problem for us…

Same here.
The message “WARN:PickListMenu:isc_PickListMenu_0:fields and completeFields are null and there is no DataSource” appears when I call “selectItem.setSortField(“f_varianten_name”);”.
If I don’t call it, there is no warn message.

Using SmartGWT 3.0p EE

Same problem… any answer from Isomorphic ?

Looks like this is still happening.

I’ve just been cleaning up any funny warnings and errors from my project.

SmartGWT version: v8.3p_2012-11-25/PowerEdition Deployment 2012-11-25
Browser: FF 17 dev mode

Simple simple example:

	public void onModuleLoad() {

		SelectItem cmbSection = new SelectItem();
		cmbSection.setShowTitle(false);
		cmbSection.setColSpan(1);
		cmbSection.setOptionDataSource(DataSource.get("section"));
		cmbSection.setValueField("id");
		cmbSection.setDisplayField("name");
		cmbSection.setEmptyDisplayValue("All Sections");
		cmbSection.setAllowEmptyValue(true);
		cmbSection.setSortField("name");
		cmbSection.setCachePickListResults(false);

		DynamicForm form = new DynamicForm();
		form.setItems(cmbSection);
		form.draw();
	}

Application starts, warning:

If the setSortField method is not called there is no warning.

We still have no definitive instance where this warning is spurious. In this most recent test case, the DataSource isn’t shown; if it’s missing the valueField or displayField or has no fields, then this warning is correct.

Apologies…the datasource is a vanilla SQLDatasource backed my MySQL. Quite literally nothing in it:

<DataSource
	ID="section"
	serverType="sql"
	tableName="section"
	autoDeriveSchema="true">
		
</DataSource>

The specified fields exist in the database, see attached.

Screenshot - 4_12_2012 , 11_05_25 AM.png

If you explicitly declare the fields, does the warning go away? If so, we think we know what the issue is.

Unfortunately not, with the fields explicitly declared the warning still shows.

public void onModuleLoad() {

	SelectItem cmbSection = new SelectItem();
	cmbSection.setOptionDataSource(DataSource.get("section"));
	cmbSection.setValueField("id");
	cmbSection.setDisplayField("name");
	cmbSection.setSortField("name");
		
	DynamicForm form = new DynamicForm();
	form.setItems(cmbSection);
	form.draw();
}
<DataSource 
	ID="section" 
	serverType="sql" 
	tableName="section"
	autoDeriveSchema="true">

	<fields>
		<field name="id" primarKey="true" hidden="true" type="sequence"/>
		<field name="name" type="text"/>
	</fields>

</DataSource>
20:38:43.491 [ERROR] [sgwt_test] 20:38:43.502:WARN:PickListMenu:isc_PickListMenu_0:fields and completeFields are null and there is no DataSource

com.smartgwt.client.core.JsObject$SGWT_WARN: 20:38:43.502:WARN:PickListMenu:isc_PickListMenu_0:fields and completeFields are null and there is no DataSource
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    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.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:299)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at com.smartgwt.client.widgets.BaseWidget.draw(BaseWidget.java)
    at au.com.group1solutions.tests.client.Sgwt_test.onModuleLoad(Sgwt_test.java:24)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:406)
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Unknown Source)

Firefox 10
gwt 2.5
Smartgwt 3.1p nightly 02252013

I would simply like to add a few findings to this post.
I just downloaded the most recent nightly build.

The problem and a variation of the problem seems to still persist…

Using the SelectItem as follows…

		SelectItem company = new SelectItem("CompanyId");
        company.setTitle("Select Company");
        company.setOptionDataSource(companiesDS);
        company.setValueField("CompanyId");
        company.setDisplayField("CompanyName");
        company.setRequired(true);
        company.setSortField("CompanyName");

When I execute the code, the SelectItem does not show the available fields from the options datasource and the following error is shown in the console…

20:44:05.900 [ERROR] [mproject] 20:44:05.900:MUP8:WARN:PickListMenu:isc_PickListMenu_2:fields and completeFields are null and there is no DataSource

com.smartgwt.client.core.JsObject$SGWT_WARN: 20:44:05.900:MUP8:WARN:PickListMenu:isc_PickListMenu_2:fields and completeFields are null and there is no DataSource
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    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.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:299)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at com.smartgwt.client.widgets.Canvas.show(Canvas.java)
    at com.dws.managemymanifest.client.projectinfo.AddUserWindow.<init>(AddUserWindow.java:145)
    at com.dws.managemymanifest.client.projectinfo.ProjectInfoTabPane$2.onClick(ProjectInfoTabPane.java:136)
    at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:101)
    at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:1)
    at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
    at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:71)
    at sun.reflect.GeneratedMethodAccessor258.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    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:338)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
    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:242)
    at sun.reflect.GeneratedMethodAccessor257.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    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: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(Unknown Source)

However, when i switch to using a ComboBoxItem the available fields are correctly displayed the first time, and subsequent times the following error is shown…

		ComboBoxItem company = new ComboBoxItem("CompanyId");
        company.setTitle("Select Company");
        company.setOptionDataSource(companiesDS);
        company.setValueField("CompanyId");
        company.setDisplayField("CompanyName");
        company.setRequired(true);
        company.setSortField("CompanyName");
20:47:32.501 [ERROR] [mproject] 20:47:32.513:MUP5:WARN:Log:ReferenceError: requestProperties is not defined
Stack from error.stack:
    unnamed(undef, undef) @ mproject/sc/modules/ISC_Forms.js:1353
    unnamed() @ mproject/sc/modules/ISC_Forms.js:1331
    ComboBoxItem.showPicker() @ mproject/sc/modules/ISC_Forms.js:1722
    unnamed({Obj}, {Obj}, {Obj}) @ mproject/sc/modules/ISC_Forms.js:642
    FormItem._iconClick("picker") @ mproject/sc/modules/ISC_Forms.js:910
    DynamicForm.handleClick(_1=>{Obj},  _2=>undef) @ mproject/sc/modules/ISC_Forms.js:425
    [c]EventHandler.bubbleEvent(_1=>{Obj},  _2=>"click") @ mproject/sc/modules/ISC_Core.js:1187
    [c]EventHandler.handleClick(_1=>{Obj}) @ mproject/sc/modules/ISC_Core.js:1063
    EventHandler._handleMouseUp([object MouseEvent], undef) @ mproject/sc/modules/ISC_Core.js:1054
    [c]EventHandler.handleMouseUp(_1=>[object MouseEvent]) @ mproject/sc/modules/ISC_Core.js:1046
    [c]EventHandler.dispatch(_1=>isc_c_EventHandler_handleMouseUp,  _2=>[object MouseEvent]) @ mproject/sc/modules/ISC_Core.js:1217
    anonymous([object MouseEvent]) @ mproject/sc/modules/ISC_Core.js:64
    unnamed() @ 


com.smartgwt.client.core.JsObject$SGWT_WARN: 20:47:32.513:MUP5:WARN:Log:ReferenceError: requestProperties is not defined
Stack from error.stack:
    unnamed(undef, undef) @ mproject/sc/modules/ISC_Forms.js:1353
    unnamed() @ mproject/sc/modules/ISC_Forms.js:1331
    ComboBoxItem.showPicker() @ mproject/sc/modules/ISC_Forms.js:1722
    unnamed({Obj}, {Obj}, {Obj}) @ mproject/sc/modules/ISC_Forms.js:642
    FormItem._iconClick("picker") @ mproject/sc/modules/ISC_Forms.js:910
    DynamicForm.handleClick(_1=>{Obj},  _2=>undef) @ mproject/sc/modules/ISC_Forms.js:425
    [c]EventHandler.bubbleEvent(_1=>{Obj},  _2=>"click") @ mproject/sc/modules/ISC_Core.js:1187
    [c]EventHandler.handleClick(_1=>{Obj}) @ mproject/sc/modules/ISC_Core.js:1063
    EventHandler._handleMouseUp([object MouseEvent], undef) @ mproject/sc/modules/ISC_Core.js:1054
    [c]EventHandler.handleMouseUp(_1=>[object MouseEvent]) @ mproject/sc/modules/ISC_Core.js:1046
    [c]EventHandler.dispatch(_1=>isc_c_EventHandler_handleMouseUp,  _2=>[object MouseEvent]) @ mproject/sc/modules/ISC_Core.js:1217
    anonymous([object MouseEvent]) @ mproject/sc/modules/ISC_Core.js:64
    unnamed() @ 

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    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(Unknown Source)

I just wanted to contribute some added information on the newest nightly to hopefully help resolve this issue which would be a nice fix for possibly many.

These are both fixed - most likely something went wrong in your update attempt and you are still using older code. There are instructions in the FAQ for verifying that an update worked.

Seeing same issue with 0226 nightly

I am also having issues with a SelectItem when I use the setSortField() method to set a sort field. If I comment this one line out, the SelectItem works correctly. I tested with the 0226 nightly and still see the issue. Everything worked without error in the 0114 nightly. As with the previous poster, I am using a DataSource to populate the SelectItem.

Here is the version from the console:
SmartClient Version: v8.3p_2013-02-26/Pro Deployment (built 2013-02-26)

Here is the warning I see:
13:30:31.413:WARN:PickListMenu:isc_PickListMenu_0:fields and completeFields are null and there is no DataSource

With the 0221 nightly I would also see the requestProperities issue:
10:56:29.086:MOU6[E]:WARN:Log:Error:
‘‘requestProperties’ is undefined’
in http://vmgene3.oc.com:8080/dtcdev/dtcollector/sc/modules/ISC_Forms.js
at line 1352
crashed in: PickList.setUpPickList()

Correction - the requestProperties issue was previously only fixed for 4.0 because we thought that was the only build where it was happening. It’s now been fixed for 3.1 as well, for tomorrow’s builds.

v8.3p_2013-05-14/EVAL Deployment, Firefox 20

  1. Add a FilterBuilder to layout
  2. Set its DataSource (to an already loaded, non-null one)
  3. Click one of the filter’s “selectItem” dropdowns (field / operator).
  4. DevConsole gives:
18:55:43.810:IFCS8:WARN:PickListMenu:isc_PickListMenu_0:fields and completeFields are null and there is no DataSource
19:16:42.854:TMR5:WARN:DataSource:R_f1c5475d_82ec_4d77_bab5_0c62cb735551_helper:clientOnly add operation:
[B] Duplicate key[/B]: {canEdit: false,
hidden: false,
name: "ID_DZIAL",
primaryKey: true,
sequenceName: "SEQ_DZIALY",
type: "sequence",
columnCode: "b80bb7740288fda1f201890375a60c8f"}
19:16:43.787:TMR6:WARN:DataSource:R_f1c5475d_82ec_4d77_bab5_0c62cb735551_helper:clientOnly add operation:
[B]Duplicate key[/B]: {length: 20,
name: "NAZWA",
required: true,
type: "text",
columnCode: "b068931cc450442b63f5b3d276ea4297"}
19:16:43.987:TMR7:WARN:DataSource:R_f1c5475d_82ec_4d77_bab5_0c62cb735551_helper:clientOnly add operation:
[B]Duplicate key[/B]: {name: "TEST",
required: false,
type: "integer"}
19:17:09.028:IFCS4:WARN:PickListMenu:isc_PickListMenu_1:fields and completeFields are null and there is no DataSource
IFCS4:WARN:PickListMenu:isc_PickListMenu_1:fields and completeFields are null and there is no DataSource

The ds.xml does not include any duplicate fields; moreso, there is no value that would be duplicate for any two records, no matter the combination of columns.

What key is SmartGWT on about?
Just knowing that would help me get to the root of the problem - ideas, almighty Isomorphic? Or anyone else?

EDIT: If I click in the TextItem that lets you edit the value to filter by, all is well and I get no warning.
If so, the filter’s selectItem handlers seem like a good place to check out (just my tuppence worth).

SmartGWT is telling you that you tried to add a record to a clientOnly DataSource, but there was already a record with such a key. So your primaryKey field(s) are the ones to examine for collisions.

You seem to be getting the warning about “fields and completeFields”. We believe we’ve eliminated all the causes for this error message to appear spuriously - if you can find another way to trigger it spuriously, it would be great to get runnable code for that.

Problem still exists

Isomorphic SmartClient Version v8.3p_2013-05-26 (2013-05-26)
GWT 2.5
Firefox 21.0, Chrome 23.0.1271.95.
Ubuntu 12.10

Hello,

I have retested “ql20080101” code using 3.1p 2013-05-26
and the PickListMenu warning still exists.

Debug mode output:

As pointed out in the original post, by commenting out the function setSortField(str), no warning is shown.

// comboBox.setSortField("display");

Thanks

This has been fixed - please retest with a nightly build dated May 30 or later

I confirmed that it has been fixed in Isomorphic SmartClient version v8.3p_2013-05-30 (2013-05-30).

Thanks