Announcement

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

    PickListMenu warning error

    I have 3 relatively simple SelectItems on a form. Here is the code that sets them up. (Using SmartGWT 2.3 nightly from 12th August with Firefox)
    Code:
    SelectItem hven = new SelectItem("HVEN");
    hven.setSortField("VVEN");
    hven.addChangedHandler(new ChangedHandler() {
    	@Override
    	public void onChanged(ChangedEvent event) {
    		setVendorDefaults();
    	}
    });
    formFields.add(hven);
    
    SelectItem hstr = new SelectItem("HSTR");
    Criteria hstrCriteria = new Criteria("SARC", "Y");
    hstrCriteria.addCriteria(new Criteria("SAOR", "Y"));
    hstr.setPickListCriteria(hstrCriteria);
    hstr.setSortField("SSTR");
    formFields.add(hstr);
    
    SelectItem hdpt = new SelectItem("HDPT");
    hdpt.setSortField("DDPT");		
    formFields.add(hdpt);
    They all generate this WARN message in the log when the form is displayed. What is the warning message trying to tell me? The form to which they are being added does have a datasource assigned and all of the referenced fields do exist in that datasource. The SelectItems actually work but I'm having other problems when trying to extend their behavior so I'm trying to eliminate these WARNings before adding additional attributes.
    Code:
    09:29:42.108 [ERROR] [ipgui] 09:29:42.107:XRP1:WARN:PickListMenu:isc_PickListMenu_1:fields and completeFields are null and there is no DataSource
    com.smartgwt.client.core.JsObject$SGWT_WARN: 09:29:42.107:XRP1:WARN:PickListMenu:isc_PickListMenu_1:fields and completeFields are null and there is no DataSource
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        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:157)
        at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:284)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
        at com.smartgwt.client.widgets.Canvas.show(Canvas.java)
        at com.islandpacific.gui.client.PoHeaderCanvas.editPo(PoHeaderCanvas.java:1926)
        at com.islandpacific.gui.client.PoHeaderCanvas.access$25(PoHeaderCanvas.java:1915)
        at com.islandpacific.gui.client.PoHeaderCanvas$43$1.execute(PoHeaderCanvas.java:1807)
        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:597)
        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:157)
        at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
        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:188)
        at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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:157)
        at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
        at java.lang.Thread.run(Thread.java:637)

    #2
    Since neither SelectItem has a valueMap or optionDataSource, they are trying to use the DataSource of the overall form as their optionDataSource, and possible within that DataSource there is no same-named field.

    Comment


      #3
      The form to which they are being added does have a datasource assigned and all of the referenced fields do exist in that datasource.
      They each have their own optionDataSource defined in the ds.xml. As I said, they all work as expected, showing the records from each of their assigned optionDataSources. Just the warning message appears.

      Comment


        #4
        OK, we've already checked that similar samples are not showing a spurious warning. Let us know if you narrow it down and if it proves to be spurious, we'll eliminate it.

        Comment


          #5
          I'm still getting this "warning" in a few different places and in all cases the SelectItem works as expected. They all have fields and data sources defined. Here is probably the simplest example. The error appears when the SelectItem is first displayed.

          I noticed on another post regarding this same warning that they thought it had something to do with setSortField() so I tried removing that one line and indeed the message does go away.
          Code:
          // Create a form for the file group selector
          fileGroupSelect = new SelectItem("FFGP");
          fileGroupSelect.setValueField("FFGP");
          fileGroupSelect.setDisplayField("FFGP");
          fileGroupSelect.setOptionDataSource(DataSource.get("IPFGCTL"));
          fileGroupSelect.setOptionCriteria(new Criteria("FAPP","PO"));
          fileGroupSelect.setTextAlign(Alignment.RIGHT);
          fileGroupSelect.setAllowEmptyValue(true);
          fileGroupSelect.setSortField("FFGP");
          fileGroupSelect.setWidth(50);
          fileGroupSelect.setAutoFetchData(false);
          
          // This event fires whenever the fileGroupSelect is clicked on (dropdown occurs)
          fileGroupSelect.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
          	@Override
          	public void onClick(
          			com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
          		// Refresh the fileGroupSelect list to ensure any new file groups
          		// added by other users will show up for the current user immediately
          		fileGroupSelect.fetchData();
          	}
          });
          
          // This event fires whenever a FileGroup is selected from the list
          fileGroupSelect.addChangedHandler(new ChangedHandler() {
          
          	@Override
          	public void onChanged(ChangedEvent event) {
          		if (event.getValue()==null) {
          			newPoButton.setDisabled(true);
          			getPendingPoGrid().setData(new Record[0]);
          		}
          		else {
          			newPoButton.setDisabled(!userIsAuthorizedToEditPOs);
          			setCurrentFileGroup(Integer.parseInt(event.getValue().toString()));
          		}
          		fetchPendingPoGridData();				
          	}
          });
          DynamicForm form = new DynamicForm();
          form.setDataSource(DataSource.get("IPFGCTL"));
          form.setWrapItemTitles(false);
          form.setFields(fileGroupSelect);
          And here is the data source.
          Code:
          <DataSource ID="IPFGCTL" dataFormat="iscServer" serverType="sql"
          	dbName="as400" sparseUpdates="true" tableName="IPFGCTL"
          	serverConstructor="com.islandpacific.gui.server.customDataSource.IpDataSource">
          	<!-- 
          	File group control file.
          	-->
          	<fields>
          	 <field name="FAPP" title="Application Code" type="text" length="2" primaryKey="true"/>
          	 <field name="FFGP" title="File Group" type="integer" length="3" primaryKey="true"/>
          	 <field name="FSTS" title="Status A,B,R" type="text" length="1">
          		 <valueMap>
          		 	<value ID="A">Available</value> 
          		 	<value ID="B">Reserved</value>
          		 	<value ID="R">Locked</value>
          		 </valueMap>
          	 </field>
          	 <field name="FUSR" title="User" type="text" length="4"/>
          	 <field name="FWSN" title="Workstation" type="text" length="3"/>
          	 <field name="FPGM" title="Program" type="text" length="10"/>
          	 <field name="FLOG" title="Log Records" type="integer" length="3"/>
          	 <field name="FJID" title="Job Id" type="text" length="10"/>
          	 <field name="FCLR" title="Clear File Group?" type="text" length="1"/>
          	 <field name="FFIL" title="File Containing Fgs" type="text" length="10"/>
          	 <field name="FFGCSTS" title="Po Print Fgp Conflict Status" type="text" length="1"/>
          	 <field name="FFGCUSR" title="Po Print Fgp Conflict Userid" type="text" length="10"/>
          	 <field name="FFGCJID" title="Po Print Fgp Conflict Jobid" type="text" length="10"/>
           	</fields>
          </DataSource>

          Comment


            #6
            Hi,

            Any news on a subject??
            I'm also getting the same warnings in SelectItem with set optionDataSource and even set fields list.
            So I really don't understand this message:
            Code:
            15:28:37.166:MUP9:WARN:PickListMenu:isc_PickListMenu_0:fields and completeFields are null and there is no DataSource

            Comment


              #7
              I am also getting this warning but everything works OK.

              Is there any reason to be concerned or something that I need to do in the code to make the warning go away?

              Comment

              Working...
              X