Announcement

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

    Weird ComboBox filtering issue

    SmartGWT v8.2p_2013-02-06/LGPL Development Only (built 2013-02-06)

    Using IE9, tried in dev and regular mode

    I'm having a weird issue. Let's say I have a part and it is part "1234abcd". I want to have my combo box hit the server when searching. The combo box is set up with valueField/displayField. It works fine until I enter 4 or more numbers into the combo box, then it changes its search criteria.

    For instance, here are my server calls when searching for a part starting with 2572:

    1)
    Code:
    <_constructor>AdvancedCriteria</_constructor>
    <criteria>
    	<criterion>
    		<fieldName>partNo</fieldName>
    		<operator>iContains</operator>
    		<value>25</value>
    	</criterion>
    ...
    2)
    Code:
    <_constructor>AdvancedCriteria</_constructor>
    <criteria>
    	<criterion>
    		<fieldName>partNo</fieldName>
    		<operator>iContains</operator>
    		<value>257</value>
    	</criterion>
    ...
    3)
    Code:
    <data>
    	<id>2572</id>
    </data>
    ...
    I noticed that the request for call 3 comes from the ListGrid that the ComboBox is within. The first two calls come from isc_PickListMenu_1.

    Any ideas?

    Thanks,
    Brian

    #2
    Additionally, it shows the following on the DSRequest for the offending call:

    Code:
    "callback":{
    	"target":[ComboBoxItem ID:isc_ComboBoxItem_6 name:partId], 
    	"methodName":"fetchMissingValueReply"
    },
    whereas the good calls show this:
    Code:
    "callback":{
    	"caller":[ResultSet ID:isc_ResultSet_2 (created by: isc_PickListMenu_1)], 
    	"methodName":"fetchRemoteDataReply"
    },

    Comment


      #3
      It doesn't look like there's anything coming from a ListGrid. The fetch you're seeing would happen as a result of the FormItem.fetchMissingValues behavior (see docs for this), which is used by the ComboBoxItem.

      Assuming you are using RestDataSource, the request is a valid one and your server should respond appropriately. You will get similar requests from other FormItems, in the circumstances described in the fetchMissingValues docs.

      Comment


        #4
        Originally posted by Isomorphic View Post
        It doesn't look like there's anything coming from a ListGrid. The fetch you're seeing would happen as a result of the FormItem.fetchMissingValues behavior (see docs for this), which is used by the ComboBoxItem.

        Assuming you are using RestDataSource, the request is a valid one and your server should respond appropriately. You will get similar requests from other FormItems, in the circumstances described in the fetchMissingValues docs.
        Why is it calling fetchMissingValues when I haven't selected anything? And why is it passing the values I've typed into the box as the ID?

        "The fetch occurs if the item value is non null on initial draw of the form or whenever setValue() is called."

        Comment


          #5
          We don't have nearly enough information to answer that, but, broadly speaking, the ComboBox is passing what you've configured it to believe is an appropriate ID (based on primaryKey/valueField/what's in your Records) and it believes it hasn't been given a displayValue for this ID (which could be because you programmatically setValue() with that ID, or your records were missing a value for the displayField).

          The above is not an exhaustive list of possible misconfigurations.

          If you think it's a bug in the framework, try putting together simple code demonstrating an issue, and we can take a look.

          Comment


            #6
            I think what's happening here is that we are also using a REGEXP filter criteria. However, it's not valid SmartGWT regex (it is regex that is able to be processed by our server). So when the data set gets small enough and SmartGWT switches to client side filtering it drops the entire dataset because it doesn't know how to process our regular expression.

            The last fetch using the ID is after the data set has been dropped and it thinks I've "selected" something and tries to fetch missing values.

            I'll try forcing server-side filtering and see if that fixes things.

            Comment


              #7
              That did the trick! Sorry to waste your time. I should have never doubted you. :P

              Brian

              Comment

              Working...
              X