Announcement

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

    SelectItem.setMultiple don't show values when loaded

    Hi,

    there is a bug in SelectItem. When I set
    Code:
    dynamicFlag.setOptionDataSource(DataSource.get("brancheFlagDS"));
    dynamicFlag.setAlwaysFetchMissingValues(true);
    dynamicFlag.setValueField("id");
    dynamicFlag.setDisplayField("name");
    dynamicFlag.setPickListFilterCriteriaFunction(new FormItemCriteriaFunction() {...});
    dynamicFlag.setMultiple(true);
    
    dynamicFlagItem.setValues(String[]);
    This result in blank selection. When I expand the selection then the Select item correctly check selected values and the value field get filled as well.

    I use smartGWT 2011-06-09 tested on Firefox 4.0.1, IE9.0.8112 with and withou compatibility mode.

    #2
    Try creating a standalone test case that we can run and that you've tried against the latest nightly.

    Comment


      #3
      Hi,

      I have prepared a testcase by modifying ds-dmi from the 2011-06-15.

      The symptoms are visible on a video located at http://www.zdary.cz/testcase.wmv
      The testcase is located at http://zdary.cz/ds-dmi.zip

      We have a similar problem and I think it is the same.
      Sometimes the SelectItem with OptionalDatasource load the data but fail to convert it to the displayfield. It gets fixed when you expand the SelectItem.
      This time the SelectItem is connected to the datasource from a dynamicform properly (I don't have to call setValue()).

      Cheers,
      Zdary

      Comment


        #4
        A testcase should be minimal - a single file unless that is impossible. In this case, it should be possible using clientOnly DataSources. If not, then it's probably not a bug.

        Comment


          #5
          Hi,
          I limited the number of files to 4.
          I spent quite a lot of time developing this testcase. Do you really demand using clientOnly datasource? Shouldn't SelectItem be able to work with all types of DS?

          Cheers,
          Zdary
          Attached Files

          Comment


            #6
            It does work with all kinds of DS. What we need you to demonstrate is that it does not work in a situation where it's clear that the reason is not a faulty DMI or similar problem.

            Comment


              #7
              I cannot simulate this error on a clientOnly DS. But it doesn't mean that there is no error.

              There is a difference if you have all data immediatelly available in clientOnly DS or if you have to wait for a callback with data.

              best regards,
              Zdary

              Comment


                #8
                No, not the case - clientOnly DataSources simulate paging, returning only partial results if there is more data available than is requested by a component, just like a remote DataSource. This result suggests the problem is with your DMI.

                Comment


                  #9
                  Got it. I managed to reproduce the problem using clientOnlyDS.

                  best regards,
                  Zdary
                  Attached Files

                  Comment


                    #10
                    Thanks - that's very helpful.

                    We now see the problem and are looking at how best to fix it in the framework.
                    For now you can workaround this issue by adding explicit pickListProperties to your multiple:true select item.
                    Code:
                       ...
                            boundForm.setFields(dynamicFlag1Item, dynamicFlag2Item, dynamicFlag3Item);
                            dynamicFlag2Item.setMultiple(true);
                            ListGrid pickListProperties = new ListGrid();
                            dynamicFlag2Item.setPickListProperties(pickListProperties);
                       ...

                    Comment


                      #11
                      great,

                      thank you,
                      Zdary

                      Comment


                        #12
                        Hi,

                        one more observation.

                        if you set dynamicFlag.setAllowEmptyValue(true); to a multiValue:true then it renders an 'undefined' checkbox. In this case the extra checkbox is not needed as users should uncheck all others instead.

                        Cheers,
                        Zdary

                        Comment


                          #13
                          Good point - we've made the change to not show the empty row at the top of the list in this case.

                          Thanks
                          Isomorphic Software

                          Comment


                            #14
                            Hi,

                            I have retested this using 2011-06-24 and found afew more bugs.

                            A new testcase attached, use Datasource class from previous upload.
                            See a video located on www.zdary.cz/testcase2.wmv

                            1) SelectItem, multiple:true passes validation if required is set to true but you need to check something and then uncheck all. then the validation doen't work.

                            2) SelectItem setRequired(true) setAllowEmptyValue(true) when it is attached to optionalDataSource and there is no value then it renders a small box without any text.

                            3) SelectItem multiple:true. getValues() returns some javascript object instead of String or String[]

                            4) SelectItem isMultile() method is missing.

                            Cheers,
                            Zdary
                            Attached Files

                            Comment


                              #15
                              Hi Zdary,
                              We have made some changes to resolve these issues. Specific comments:

                              1) This should be fixed with the next nightly build.
                              2) This should already have been fixed - recommend testing with the next nightly build as well
                              3) We're not reproducing this as an issue. We modified the attached test case to include a test for getValues() and it appears to be doing the right thing for us. Please re-test this with the latest nightly and if you are still seeing a bug, let us know along with test code that demonstrates this particular issue. Thanks.
                              Our test code:
                              Code:
                                      Button button2 = new Button("get values");
                                      button2.addClickHandler(new ClickHandler() {
                                          
                                          @Override
                                          public void onClick(ClickEvent event) {
                                              SelectItem item = (SelectItem)boundForm.getItem("flag2");
                                              String[] vals = item.getValues();
                                              for (int i = 0; i < vals.length; i++) {
                                                  SC.logWarn(vals[i]);
                                              }
                                              
                                          }
                                      });
                                      vStack.addMember(button2);
                              4) SelectItem.getMultiple() already exists as a getter to determine whether the selectItem is multiple:true or not. We've now also added the synonym "isMultiple" for clarity

                              Thanks
                              Isomorphic Software

                              Comment

                              Working...
                              X