Announcement

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

    SmartClient issue with ComboBox while typing fast and slow

    Hi Isomorphic, I am using SmartClient version 10 updated on March 16th 2017. I have a Combobox which is tied to a datasource. The combobox displays a column value from the datasource. It has 20 items. Items are of value : broadcast_consumer1, broadcast_consumer2, broadcast_consumer3, consumer_user, DemoConsumer, userapi_consumer, user_consumer, user_consumer_zip, etc. When a user types the letter "cons" slowly, it just displays one record : consumer_user. When a user types the letter "cons" fast, it displays all the 8 records out of 20 : roadcast_consumer1, broadcast_consumer2, broadcast_consumer3, consumer_user, DemoConsumer, userapi_consumer, user_consumer, user_consumer_zip.

    I see that the functionality was working fine in SmartClient version 8. In version 8, I see the below logs in debug mode :

    11:36:51.224:TMR6:INFO:DataSource:partnerList_DS:Text match style specified as 'startsWith': This is not supported for this dataSource - performing a substring match instead

    The search is with substring and not "startsWith".

    In version 10, it is sometimes"startsWith". Is there a way, where I can specify the search in combo box as substring and not startsWith. The above logger statement is missing in version 10. It displays the below log :

    11:40:02.672:TMR7:INFO:AdvancedCriteria:Criteria object:{OrganizationName: "cons"} not explicitly marked as AdvancedCriteria - treating as SimpleCriteria.

    Please help us in resolving this issue. Search is returning results incorrectly. I want the search to be done with substring.

    #2
    The textMatchStyle to use is configured via comboBoxItem.textMatchStyle (unsurprisingly).

    If you have overridden getPickListFilterCriteria() you may be returning AdvancedCriteria that use another operator.

    We don't see a way you could have gotten that warning in version 8 without overriding internal methods, so there's probably some longstanding usage error here that is now causing a worse problem in the new version.

    You haven't specified whether this filtering is happening client or server. If it's server, use the RPC tab to see if the server is returning the right results. If it's client-side, turn on the "ResultSet" log category to see some logs about the filtering process - this may show you where the criteria becomes something other than you expect.

    If we are to help further, we'll need a way to reproduce the problem.

    Comment


      #3
      Hi Isomorphic, Thanks for the reply. The filtering is happening in client. The below API in javascript is resolving the issue.


      basicSearchForm.getItem("bsfConsumer").textMatchStyle="substring";

      Comment


        #4
        That's invalid code, because textMatchStyle is not settable after init (note the flags are "IR" not "IRW"). However, you can set the same property correctly by just providing it as a property when creating the "bsfConsumer" item.

        Comment


          #5
          Hi Isomorphic, Thanks for letting me know. I changed my code as below and it is working fine.

          {
          ID:"bsfConsumer",
          name:"bsfConsumer",
          title:xyz_i18n.CONSUMER,
          selectOnFocus:true,
          _constructor:"ComboBoxItem",
          editorType: "comboBox",
          prompt: helpTextRouteSearchModule.bsfConsumer,
          valueField: "OrganizationKey",
          displayField: "OrganizationName",
          optionDataSource: list_DS,
          pickListHeight: 200,
          autoFetchData:false,
          startRow:true,
          showOptionsFromDataSource:true,
          pickListProperties : { dataProperties : { fetchDelay: 500} },
          width:300,
          colSpan:1,
          length:100,
          textMatchStyle:"substring"
          }

          Comment

          Working...
          X