Announcement

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

    Minor bug(?) with SelectItem when not explicitly using setOptionDataSource

    Hi Isomorphic,

    when not explicitly using setOptionDataSource() for a .ds.xml field that already has a foreignKey defined and therefore already has an implicit optionDataSource, the framework generates two requests and also the loading of the SelectItem data is broken. See the very same testcase as here (also v10.1p_2017-08-03, FF26 Dev Mode), but comment out one line in private class ListGridFieldLifeSpan:

    Code:
        private class ListGridFieldLifeSpan extends ListGridField {
            public ListGridFieldLifeSpan(final String name) {
                super(name);
    
                SelectItem mySI = new SelectItem();
    [B]// mySI.setOptionDataSource(DataSource.get("employees"));[/B]
                mySI.setDisplayField("Name");
                mySI.setSortField("Salary");
                setEditorProperties(mySI);
                setFilterEditorProperties(mySI);
            }
        }
    Now on load, this happens:
    Click image for larger version  Name:	BrokenSelectItem.gif Views:	1 Size:	103.8 KB ID:	248216

    Issues:
    • "Loading..." string stays
    • Queue 3 is twice a PickList-fetchRemoteDataReply request, once with sortBy:["Salary"] and once without
    Of course it is not common to have code like this I'd guess because it's not very self-explanatory but still, it breaks.

    Best regards
    Blama

    #2
    Two requests isn't something we're trying to prevent in this case. As you say, this is not common usage, and perhaps too synthetic to have ever actually happened outside a test case.

    But we will check on why the data load fails. This is being given low severity so it may take a while.

    Comment


      #3
      Hi Isomorphic,

      low severity is fine, but please note that this is not about having two requests, it's about having two different requests. IMHO sortBy:["Salary"] should be present in both.

      Best regards
      Blama

      Comment


        #4
        Have you tried this with a build since August 14, when we fixed the other issue you linked to? If not, please do so.

        Comment


          #5
          Hi Isomorphic,

          sorry me being so slow with the retests currently. This is happening now on the 1st load of the application (v11.1p_2017-08-16):
          Click image for larger version

Name:	ComboBoxItem_Load.PNG
Views:	57
Size:	9.0 KB
ID:	248496

          Issues:
          • "Loading..." string now replaced by ID (Name expected)
          • Queue 3 is twice a PickList-fetchRemoteDataReply request, once with sortBy:["Salary"] and once without (as before)
          Best regards
          Blama

          Comment


            #6
            Apologies for the delay on this - you just need to add mySI.setValueField("EmployeeId"), and you should see everything work as expected.

            Comment

            Working...
            X