Announcement

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

    MultiComboBoxItem, optionCriteria and fetchMissingValues

    I am having some problems with my databound MultiComboBoxItem.
    I was trying to stop it from fetching missing values by setting:
    Code:
    multiComboBoxItem.setAutoFetchData(true);
    multiComboBoxItem.setFetchMissingValues(false);
    but it still sends a fetchMissingValues request event though the first fetch contains all the values.

    Then I noticed that the optionCriteria that i set (scrumTask & projectId) was only added to the criteria in the fetchMissingValues request, and not the initial auto fetch.

    Am I misunderstanding something or is the optionCriteria not supposed to go on both types of fetch, and how do I stop it from fetching missing values?

    fetchMissingValues DS Request example:
    Code:
    {
        dataSource:"tags_globalTags", 
        operationType:"fetch", 
        componentId:"isc_DynamicForm_6", 
        data:{
            scrumTask:1, 
            projectId:703, 
            companyTagId:[
                64, 
                1381, 
                116, 
                117, 
                33, 
                35, 
                54, 
                34, 
                32, 
                36, 
                146, 
                94
            ]
        }, 
        textMatchStyle:"exact", 
        callback:{
            target:[MultiComboBoxItem ID:isc_MultiComboBoxItem_2 name:tags], 
            methodName:"fetchMissingValueReply"
        }, 
        showPrompt:false, 
        oldValues:{
            scrumTask:1, 
            projectId:703, 
            companyTagId:[
                64, 
                1381, 
                116, 
                117, 
                33, 
                35, 
                54, 
                34, 
                32, 
                36, 
                146, 
                94
            ]
        }, 
        requestId:"tags_globalTags$62737", 
        internalClientContext:{
            newValue:{
                "0":64, 
                "1":1381, 
                "2":116, 
                "3":117, 
                "4":33, 
                "5":35, 
                "6":54, 
                "7":34, 
                "8":32, 
                "9":36, 
                "10":146, 
                "11":94, 
                Class:"Array", 
                localeStringFormatter:"toString"
            }, 
            filterLocally:{
            }, 
            targetField:"companyTagId", 
            fetchingMissingValues:{
            }
        }, 
        fallbackToEval:false, 
        componentContext:"tags", 
        lastClientEventThreadCode:"XRP6", 
        bypassCache:true
    }
    Auto fetch DS Request example:
    Code:
    {
        dataSource:"tags_globalTags", 
        operationType:"fetch", 
        componentId:"isc_PickListMenu_0", 
        data:{
        }, 
        startRow:0, 
        endRow:75, 
        textMatchStyle:"startsWith", 
        resultSet:[ResultSet ID:isc_ResultSet_2 (dataSource: tags_globalTags, created by: isc_PickListMenu_0)], 
        callback:{
            caller:[ResultSet ID:isc_ResultSet_2 (dataSource: tags_globalTags, created by: isc_PickListMenu_0)], 
            methodName:"fetchRemoteDataReply"
        }, 
        willHandleError:true, 
        showPrompt:false, 
        prompt:"Finding Records that match your criteria...", 
        oldValues:{
        }, 
        requestId:"tags_globalTags$62723", 
        internalClientContext:{
            requestIndex:1
        }, 
        fallbackToEval:false, 
        componentContext:"isc_MultiComboBoxItem_1_comboForm.cb", 
        lastClientEventThreadCode:"XRP0", 
        bypassCache:true
    }

    #2
    Is this being looked at?

    Comment


      #3
      A couple of things here:

      1. when you say the "first fetch contains all the values", what exactly are you talking about? A fetch initiated by the MultiComboBoxItem as it is first rendered? Or initiated when the picklist opens?

      2. Bear in mind that, if the first fetch response for the picklist contains all values, this is too late to allow the initial rendering of a MultiComboBoxItem that is populated with initial values - it still needs a separate fetch for that. So it does not seem as though fetchMissingValues:false is actually a valid or workable setting for MultiComboBoxItem. Given this, if you still think this setting is valid, can you explain how you would expect it to work in this case?

      3. are you using any settings on the DataSource or ResultSet that cause all available records to be pre-fetched, such as dataSource.cacheAllData, or resultSet.fetchMode:"local"?

      4. you have a weird problem in your request where a String "newValue" is incorrectly serialized as an Array. Do you see this same issue in compiled mode or SuperDevMode? What is your GWT version?

      Comment


        #4
        1. When the item is first rendered. I have autoFetchData set to true so from my understanding it shouldn't also fetch when I open the picklist right?

        2. Well the initial fetch (if autoFetchData is true) is sent before the missingValues fetch is sent, so it just seems unnecessary since the initial fetch holds all the values anyway.

        3. No

        4. Yes newValue is serialized in the same way in my current production environment. It is running SmartClient Version: v10.0p_2015-10-12/Pro Deployment (built 2015-10-12)

        Comment


          #5
          There is no way of knowing, on the client, that the server is going to return all values, potentially make a separate fetchMissingValues request unnecessary. The default is to expect just the first page of data. Data for the picklist may also not be fetched until it is opened, depending on settings.

          Overall we don't yet have a complete picture showing an unnecessary fetch, or more specifically, an unnecessary fetch that the client can and should determine is unnecessary and avoid. We can keep going with Q&A on your settings and the full set of requests you're seeing, but what might be simpler is to try to construct a test case showing a definite unnecessary fetch - especially given the weird serialization issue you're seeing, which might indicate some deeper problem is present as well.

          Comment


            #6
            Hey, sorry for the delay. An automatic Windows update bricked my laptop :/

            Okay I can understand that there is no way for the client to be sure that the server is gonna return all values, and an extra fetch request here and there is not the end of the world so go ahead and close the issue about the extra fetch.

            About the issue with serialization of newValue. I honestly don't know what internalClientContext or newValue does, so what kind of influence can this have on my MultiComboBoxItem?

            The reason I use autoFetchData on my MultiComboBoxItem is because if I dont use it then sometimes I get a bug where I can't choose items in the picklist with the mouse, the value simply doesn't get added. Setting autoFetchData:true fixed this, but maybe the error stems from the serialization issue?

            Comment


              #7
              It's hard to say whether or what influence the serialization issue would have. If there's a cause, it would be something like a GWT bug that creates a String that isn't really a String (GWT had a bug like this pre-2.5, which we describe in the FAQ).

              As far as whether it could cause the issue you see when autoFetchData is not set to true, we couldn't say, and the best thing would be to see a test case that reproduces one or both problems. Then we can take a look.

              Comment

              Working...
              X