Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    23
    Vote Rating
    0
    pete_by is on a distinguished road

      0  

    Default [FNR] (Beta) TriggerFieldCell racing conditions

    [FNR] (Beta) TriggerFieldCell racing conditions


    Looks like there are racing conditions in TriggerFieldCell class. Sometimes selected value (e.g. in ComboBox) is not updated in CellComponent, though cell itself contains it. There are three methods in TriggerFieldCell that, I suppose, called in wrong order for some reason.

    Here is the custom ComboBoxCell just to log the methods calls order:

    Code:
    ComboBoxCell<Type> customCell = new ComboBoxCell<Type>(typeStore, typeProperties.title(), typeProperties.title()) {
              @Override
              protected void clearContext() {
                    Log.info("clearContext");
                    super.clearContext();
              }
    
              @Override
              protected void saveContext(Context context, Element parent, NativeEvent event, ValueUpdater<Type> typeValueUpdater, Type value) {
                    Log.info("saveContext");
                    super.saveContext(context, parent, event, typeValueUpdater, value);
              }
    
              @Override
               protected void finishEditing(Element parent, Type value, Object key, ValueUpdater<Type> typeValueUpdater) {
                      Log.info("finishEditing");
                      super.finishEditing(parent, value, key, typeValueUpdater);
              }
        };
    Here what I get in the log:

    (AttributeViewImpl.java:87) 2011-12-08 22:03:34,950 [INFO ] clearContext
    (AttributeViewImpl.java:99) 2011-12-08 22:03:42,419 [INFO ] finishEditing
    (AttributeViewImpl.java:93) 2011-12-08 22:03:42,481 [INFO ] saveContext
    The problem is that clearContext sets valueUpdater to null:

    Code:
    protected void clearContext() {
          lastContext = null;
          lastParent = null;
          lastValueUpdater = null;
          lastValue = null;
      }
    But the TriggerFieldCell.finishEditing(...) requires lastValueUpdater to be not null in order to update value in it:

    Code:
       // Fire the value updater if the value has changed.
         if (valueUpdater != null && !vd.getCurrentValue().equals(vd.getLastValue())) {
           ... // updating value in component
    If I set a break point in clearContext() which is called from collapse(), resume execution, then saveContext() is called prior finishEditing method call (I think it because browser events occurre).

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,241
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    Thanks for digging into the code and providing a detailed report. This is now fixed in SVN. We made several changes around the order in which code is executed during an edit. You can see the latest code here:

    http://staging.sencha.com:8080/examp...e:formsexample
    http://staging.sencha.com:8080/examp...needitablegrid

    Let me know if you see anything not working correctly. Changes will go out next week in our beta 2 release.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar