Announcement

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

    Unnecessary list fetch on SelectItem display compared to ComboBoxItem

    Hi Isomorphic,

    please see this sample in the online showcase (v10.1p_2017-07-19 and SNAPSHOT_v12.0d_2017-07-19)

    Code:
    isc.DynamicForm.create({
                    width: 300, height: 30,
                    fields: [
                        {
                            ID: "testDefaultValue",
                            optionDataSource: "supplyItem",
                            name: "item",
                            type: "select",
                            displayField: "itemName",
                            sortField: "itemID",
                            valueField: "itemID",
                            title: "Item with defaultValue",
                            pickListHeight: 100,
                            defaultValue: 2,
                        }
                    ]
                });
    
    isc.DynamicForm.create({
                    width: 300, height: 30, top: 100,
                    fields: [
                        {
                            ID: "testValue",
                            optionDataSource: "supplyItem",
                            name: "item",
                            type: "select",
                            displayField: "itemName",
                            sortField: "itemID",
                            valueField: "itemID",
                            title: "Item with value",
                            pickListHeight: 100,
                            value: 2
                        }
                    ]
                });
    I'm wondering why there is a fetch on the dropdown list on load.
    I'd expect only two fetchMissingValueReply-requests. This is the case when you use type: "comboBox". IMHO there shouldn't be a difference here between comboBox and select.

    And out of interest: Why are two requests queued, which is not the case if I only create one of the two SelectItems?


    Testcase:
    Click image for larger version

Name:	requests.PNG
Views:	77
Size:	22.3 KB
ID:	245862
    Testcase with only one SelectItem:
    Click image for larger version

Name:	requests-only-one-selectitem.PNG
Views:	93
Size:	15.3 KB
ID:	245863

    Best regards
    Blama

    #2
    See selectItem.autoFetchData - SelectItems fetch in advance in order to allow typeahead for rapid data entry, with the pickList closed. End users do not generally expect to be able to quickly tab through a ComboBox in the same way, so they differ. You can configure a SelectItem not to fetch in advance via autoFetchData:false.

    The requests are queued automatically to reduce the number of server round-trips. If you're asking why there are two requests for the same record, we don't currently have a system in place to notice that this fetch is redundant, as it would be exceedingly rare in real usage.

    Comment


      #3
      HI Isomorphic,

      Originally posted by Isomorphic View Post
      See selectItem.autoFetchData - SelectItems fetch in advance in order to allow typeahead for rapid data entry, with the pickList closed. End users do not generally expect to be able to quickly tab through a ComboBox in the same way, so they differ. You can configure a SelectItem not to fetch in advance via autoFetchData:false.
      Again - impressive!

      Originally posted by Isomorphic View Post
      The requests are queued automatically to reduce the number of server round-trips.
      Yes, of course. That's why I assumed that in this testcase with only one SelectItem the requests should be queued as well:
      Code:
      isc.DynamicForm.create({
                      width: 300, height: 30, top: 100,
                      fields: [
                          {
                              ID: "testValue",
                              optionDataSource: "supplyItem",
                              name: "item",
                              type: "select",
                              displayField: "itemName",
                              sortField: "itemID",
                              valueField: "itemID",
                              title: "Item with value",
                              pickListHeight: 100,
                              value: 2
                          }
                      ]
                  });
      Best regards
      Blama

      Comment


        #4
        While you can technically enable queuing for a single request, when you submit the queue it's still just a single request, and will be shown that way in the Developer Console and elsewhere.

        Comment


          #5
          Hi Isomorphic,

          no, this results in 2 requests, which are not queued. Just see the 2nd image in #1:
          1. ​fetchMissingValueReply for value: 2 (or also defaultValue: 2)
          2. fetchRemoteDataReply for list data
          Obviously this is minor, but will be a common case. And a request less is a request less.

          Best regards
          Blama

          Comment


            #6
            Hi Blama
            Just a note: This has sat for a few days but we are seeing the issue have a developer looking at how best to resolve it. We'll follow up when we have a solution

            Regards
            Isomorphic Software

            Comment


              #7
              Hi Isomorphic,

              I found this thread by chance again. Just an FYI, the code from #1 now results in 3 unqueued requests in current v12.0p_2020-03-24 in the same sample.
              If I interpreted you correct in #6, I assumed you wanted to bring it to three request, all in the same queue.

              Best regards
              Blama

              Comment


                #8
                Thanks for the reminder.
                Yes, we did mean to make that change, and now have! Try the next nightly build to see this queuing enabled.

                It's also worth noting that developers can always use their own queuing for cases like this, something like this:
                Code:
                <script>
                <isomorphic:loadDS ID="supplyItem" />
                
                var wasQueuing = isc.RPCManager.startQueue();
                isc.DynamicForm.create({
                    ID:"form1",
                    autoDraw:false,
                                width: 300, height: 30,
                                fields: [
                                    {
                                        ID: "testDefaultValue",
                                        optionDataSource: "supplyItem",
                                        name: "item",
                                        type: "select",
                                        displayField: "itemName",
                                        sortField: "itemID",
                                        valueField: "itemID",
                                        title: "Item with defaultValue",
                                        pickListHeight: 100,
                                        defaultValue: 2
                                    }
                                ]
                            });
                
                isc.DynamicForm.create({
                    ID:"form2",
                    autoDraw:false,
                                width: 300, height: 30, top: 100,
                                fields: [
                                    {
                                        ID: "testValue",
                                        optionDataSource: "supplyItem",
                                        name: "item",
                                        type: "select",
                                        displayField: "itemName",
                                        sortField: "itemID",
                                        valueField: "itemID",
                                        title: "Item with value",
                                        pickListHeight: 100,
                                        value: 2
                                    }
                                ]
                            });
                
                form1.draw();
                form2.draw();
                if (!wasQueuing) isc.RPCManager.sendQueue();
                </script>
                *Note*: The Showcase harness does a special kind of delayed evaluation when running code in order to ensure components end up drawn in the correct parent within the hierarchy.
                So to see this in action you'll want to copy/paste the script into a new *.jsp file with the isomorphic taglib loaded

                Comment

                Working...
                X