Announcement

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

  • SelectItem infinitive fetchData loop is triggered if sortField is specified

    Hi again,

    Our new problem: In SelectItem infinitive fetchData loop is triggered if sortField is specified.

    If you run below code:
    1. Select anything in “selectItem” and “selectItem2” will fetch data and set value for the first item
    2. Open dropdown on “selectItem2” and check with SmartClient Dev Console and you will see looping fetch requests

    FYI: The code was written this way in the past because business requirement was not possible to satisfy with setDefaultToFirstOption(true);

    Issue reproduced with versions:
    smartgwt-3.1p.2013-04-24
    smartgwt-3.1p.2013-04-20
    smartgwt-3.1p.2013-04-12

    No issue with version:
    smartgwt-3.1p.2013-01-24

    Tested and reproduced with browser: FF 20.0.1

    OS sytem: Win 7

    Modified class ComboBoxStyledSample from the showcase:
    Code:
    public Canvas getViewPanel() {
     
            final DynamicForm form = new DynamicForm();
            form.setWidth(500);
           
                                   final SelectItem selectItem = new SelectItem("selectItem");
                                   final SelectItem selectItem2 = new SelectItem("selectItem2");
                                  
                                   selectItem.setValueMap("Roll", "Ea", "Pkt", "Set", "Tube", "Pad", "Ream", "Tin", "Bag", "Ctn", "Box");
                                   selectItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    String selectedValue = (String) event.getValue();
                                                                   Criteria criteria = new Criteria("units", "Roll");
                                                                  
                                                                   selectItem2.setOptionCriteria(criteria);
                                                                   selectItem2.fetchData(new DSCallback() {
                                                                                  @Override
                                                                                  public void execute(DSResponse response, Object rawData, DSRequest request) {
                                                                                                  Record[] records = response.getData();
                                                                                                  if (records.length > 0) {
                                                                                                                  selectItem2.setValue(records[0].getAttribute("itemID"));                   
                                                                                                  }
                                                                                  }
                                                                   });                                                         
                }
            });
                                  
                                   selectItem2.setOptionDataSource(ItemSupplyXmlDS.getInstance());
                                   selectItem2.setValueField("itemID");
                                   selectItem2.setDisplayField("itemName");
                                   // if you comment out this line, it will change the behaviour
                                   selectItem2.setSortField("itemName");                             
                                   selectItem2.setAutoFetchData(false);
            selectItem2.setAllowEmptyValue(false);                   
     
            form.setFields(selectItem, selectItem2);                   
            return form;
        }
    Can you please fix this asap? It is blocking our release...

    Thank you,
    Fero

  • #2
    We're taking a look at this

    Thanks
    Isomorphic Software

    Comment


    • #3
      We've made a change to address this issue. Please try the next nightly build dated April 27 or greater

      Regards
      Isomorphic Software

      Comment


      • #4
        Originally posted by Isomorphic View Post
        We've made a change to address this issue. Please try the next nightly build dated April 27 or greater

        Regards
        Isomorphic Software
        Issue is NOT fixed. Tested with version: smartgwtpower-3.1p.2013-04-27

        Comment


        • #5
          We're definitely not reproducing it using the sample code you posted, running against the April 30th build. Please re-test with the latest nightly build. If you do still see it, this implies there may be something in your application which isn't reflected in the test case code - best way to proceed in this case would be for you to get us a new test case which demonstrates the problem

          Thanks
          Isomorphic Software

          Comment


          • #6
            Build from 30th of April fixed the issue. Thanks

            Comment

            Working...
            X