Announcement

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

    Combobox fetches step on one another

    We've been having an intermittent problem with combobox items and I think I have finally discovered the source of the problem. We have a fairly typical Combobox arrangement where the pick list shows two fields, a numeric "id" and a "name". Using getPickListFilterCriteria we override the criteria such that if the user keys in only digits we try to match the id field exactly, otherwise we use a "contains" match on the name field.

    The problem occurs when they type a number into the field, say 1234. If they aren't quick, multiple fetches are sent to the server. For example, if they pause briefly after type "12" and then type "34" there may be a fetch for id=12 and another for id=1234. If the response to those fetches don't happen to be received in the order they were sent, the 1234 fetch which does return a record is overruled by the 12 fetch which does not.

    Is there any way to insure that responses to previous fetches are ignored and only the response to the last fetch issued is used?

    #2
    Still having problems with datasource backed combobox behavior.

    SmartClient Version: SC_SNAPSHOT-2011-03-24/PowerEdition Deployment (built 2011-03-24)

    When you key a value that results in a valid selection but tab out of the field before the response comes back from the fetch, the value you keyed is dropped. If you wait before pressing tab until the response comes back and then tab all is well. Here is the code that creates the combobox.

    Code:
    ComboBoxItem mySelector = new ComboBoxItem(field) {
    	@Override
    	protected Criteria getPickListFilterCriteria() {
    		if (getEnteredValue() == null || getEnteredValue().isEmpty())
    			return null;
    		if (getEnteredValue().matches("\\d*"))
    			return new AdvancedCriteria(getValueFieldName(), OperatorId.EQUALS, getEnteredValue());
    		else
    			return new AdvancedCriteria(getDisplayFieldName(), OperatorId.STARTS_WITH, getEnteredValue());
    	}
    };
    mySelector.setOptionDataSource(DataSource.get(dsName));
    mySelector.setValueField(idField);
    mySelector.setDisplayField(nameField);
    ListGrid selectorGrid = new ListGrid();
    mySelector.setPickListFields(
    		new ListGridField(idField),
    		new ListGridField(nameField)
    );
    mySelector.setPickListProperties(selectorGrid);
    mySelector.setPickListWidth(200);
    mySelector.setSortField(idField);
    mySelector.setCompleteOnTab(true);
    
    mySelector.setAddUnknownValues(false);
    mySelector.setValidateOnExit(true);

    Comment


      #3
      Also having problems with a combobox item that is NOT backed by a data source, but has a simple valueMap. If I type the first two characters of one of the display values and quickly tab out of the field the completeOnTab logic is not working. The two characters I keyed are blanked out. However, if I wait until the matching value is displayed in the picklist and then tab out it gets correctly selected.

      Here is the definition of the ComboboxItem and valueMap from the dev console. In this example, if I key "11" into the combobox and quickly tab away, the first valueMap entry is not chosen. If I slow down it is.
      Code:
      Evaluator: result of 'isc_DynamicForm_38.getItem("IATT01")' (285ms):
      ComboBoxItem{eventParent: [DynamicForm ID:isc_DynamicForm_38],
      containerWidget: [DynamicForm ID:isc_DynamicForm_38],
      form: [DynamicForm ID:isc_DynamicForm_38],
      name: "IATT01",
      editorType: "ComboBoxItem",
      completeOnTab: true,
      addUnknownValues: false,
      icons: Array[1],
      showIcons: false,
      align: "left",
      canEdit: true,
      canSave: true,
      customSelectExpression: "MAX(IPITHDR.IATT01)",
      menuItem: "Attributes>Mandatory 1",
      required: true,
      tableName: "IPITHDR",
      title: "Mandatory 1",
      type: "integer",
      width: 100,
      valueMap: Obj,
      validators: Array[2],
      ID: "isc_ComboBoxItem_17",
      pickerIconHeight: 22,
      hasFocus: false,
      filterWithValue: true,
      pickList: [PickListMenu ID:isc_PickListMenu_3],
      }
      Evaluator: result of 'isc_DynamicForm_38.getItem("IATT01").valueMap' (0ms):
      {1: "11 - test 1 - option 1",
      2: "22 - test 1 - option 2",
      3: "33 - test 1 - option 3",
      999: "ŸŸ - UNKNOWN"}

      Comment


        #4
        It looks like the second 2 posts here are the same issue. We see the cause and are determining how best to address it. We'll let you know when we've got this fixed and when we have more information on the first issue posted.

        Comment


          #5
          Hi Jay,
          We've added a theoretical fix for the first issue whereby comboBoxItems do the wrong thing if the server returns responses out of order. When this happens you should see a warning in the logs and the out of order response will be ignored.

          We've also added a fix for the other issue where rapid typing + tab could break the completeOnTab behavior.

          Both should be present in the next nightly

          Thanks
          Isomorphic Software

          Comment


            #6
            We're still seeing the "rapid typing + tab could break the completeOnTab" problem with SmartClient Version: SC_SNAPSHOT-2011-03-31/PowerEdition Deployment (built 2011-03-31). I sent instructions to support to access our demo site so you can see it in action.

            Comment


              #7
              We believe we've now resolved this (following up offline)
              Thanks

              Comment

              Working...
              X