Announcement

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

    SelecItem Warnings with 3.1d Release

    SmartClient Version: SNAPSHOT_v8.3d_2012-10-04/PowerEdition Deployment (built 2012-10-04)

    The following code example:
    Code:
    SelectItem facetSelectItem = new SelectItem("select_test", "Select Test");
    facetSelectItem.setMultiple(true);
    facetSelectItem.setMultipleAppearance(MultipleAppearance.PICKLIST);
    facetSelectItem.setValueMap("One", "Two", "Three");
    Generates several warning messages in the Developer Console:
    Code:
    21:24:03.590:selectionchange6:WARN:SelectItem:isc_SelectItem_2[select_test]:$952 - this is a multiple FormItem but newValue is not null and is not an array.
    21:24:28.314:MUP8:WARN:SelectItem:isc_SelectItem_2[select_test]:$952 - this is a multiple FormItem but newValue is not null and is not an array.
    I have an application that generates dozens of these SelectItem fields (dynamically) which results in a very large list of warning messages. I did not see these messages in the 2.5 release. Is there something in the sample code snippet that needs to be corrected?

    #2
    Technically if you are setting the value of a SelectItem with multiple set to true, you should set it to an array of values (even if that array has a single entry), rather than a single value.

    However this warning is safe to ignore - we automatically perform a conversion such that your value will be stored as a single-entry array, and on reflection we have decided to demote the warning to an "info" level log statement to avoid the noise in 3.1

    Regards
    Isomorphic Software

    Comment


      #3
      We still have a Problem with this warnings:

      Code:
      restrictPlateDesignSelectItem = new SelectItem();
      restrictPlateDesignSelectItem.setTitle("Plate Design");
      restrictPlateDesignSelectItem.setMultiple(true);
      restrictPlateDesignSelectItem.setDefaultValue("");
      restrictPlateDesignSelectItem.setValueMap(run);
      This works fine without any warning or error, except from one thing. When i select an item or two in the selectitem and then deselect them all, this warning pops out:

      Code:
      com.smartgwt.client.core.JsObject$SGWT_WARN: 15:54:44.778:MUP6:WARN:SelectItem:isc_SelectItem_7[isc_SelectItem_0]:$952 - this is a multiple FormItem but newValue is not null and is not an array.
      We dont know how to fix this Problem. Do you have some advice for us ?

      We have the newest SmartGWT version!

      Regards

      raven22k

      Comment


        #4
        If you can put together a minimal, ready-to-run test case that demonstrates that this warning can occur when your usage is correct, we can take a look.

        Comment


          #5
          Originally posted by Isomorphic View Post
          However this warning is safe to ignore
          There's one problem with that approach...you'll miss the real warnings because you get accustomed to just ignoring the red lines in the dev mode window. If I can ignore it then don't tell me.

          Furthermore, we're seeing this with ListGrid's criteria items. All the SelectItems in our forms are fine but if criteria is set on a ListGrid this warning is displayed several times for each SelectItem/PickList. This is with 3.1 2012-12-20.
          Last edited by fhisg; 17 Jan 2013, 07:38.

          Comment


            #6
            Hence the other option - put together a test case that clearly shows this is a spurious warning.

            Comment


              #7
              I am seeing the same errors. Here is a test case. BTW I'm using Firefox 8.x and smartgwt 3.1p from 2012-12-06. I was using the example from smartgwt showcase where it shows the various controls for a form. If you select an item you will see the error message as well. BTW, this error does not show up in smartgwt 3.0.

              public class MyClass implements EntryPoint {

              public void onModuleLoad() {
              HLayout layout = new HLayout();
              DynamicForm f = new DynamicForm();
              SelectItem selectItem = new SelectItem();
              selectItem.setHeight(200);
              selectItem.setTitle("Items");
              selectItem.setMultiple(true);
              selectItem.setMultipleAppearance(MultipleAppearance.GRID);
              selectItem.setValueMap("Item 1", "Item 2");
              // tried the following as well with no luck
              // selectItem.setValueMap(new String[] {"Item 1", "Item 2"});
              // selectItem.setValues(new String[] {"Item 1", "Item 2"});

              f.setItems(selectItem);
              layout.draw();

              }


              }
              Last edited by jlpuffe; 17 Jan 2013, 07:16.

              Comment


                #8
                Originally posted by Isomorphic View Post
                Hence the other option - put together a test case that clearly shows this is a spurious warning.
                Here it is. I don't see anything wrong with it. Maybe I don't understand what the error message is trying to tell me.

                Code:
                public class SmartGwt implements EntryPoint {
                  public void onModuleLoad() {
                    HLayout layout = new HLayout();
                    SelectItem facetSelectItem = new SelectItem("selectTest", "Pick");
                    facetSelectItem.setMultiple(Boolean.TRUE);
                    facetSelectItem.setMultipleAppearance(MultipleAppearance.PICKLIST);
                    facetSelectItem.setValueMap("One", "Two", "Three");
                    
                    DynamicForm form = new DynamicForm();
                    form.setFields(facetSelectItem);
                    layout.addMember(form);
                    layout.draw();
                  }
                }

                Comment


                  #9
                  Ah - yes - that warning is clearly spurious and one of our engineers is taking a look. You can ignore it for now, and it should be gone in nightly builds going forwards

                  Comment


                    #10
                    3.1.x Nightly Build

                    I would like to replace my current Smart GWT Power 3.1p release with one that removes these warnings. Is there a build release based on the 3.1 branch that I can download?

                    Comment


                      #11
                      See smartclient.com/builds and download the latest 3.1p build.

                      Comment

                      Working...
                      X