Announcement

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

    Help me use FocusChangedHandler in IE8

    Hi and thank you for the wonderful work (and forum).
    I have an issue with a DynamicForm and FocusChangedHandler in it.
    My idea is to show a "save changes" dialog when the user clicks outside the form and it works fine in Chrome. However in IE8 the FocusChanged events are not captured and I don't know what to do.

    I am using SmartGWT 2.4 and GWT 2.2.
    Here is the handler code (that works in Chrome, but not in IE).

    Code:
    public TRPDynamicForm() {
            super();
        
            this.setAutoFocus(false);
            this.addFocusChangedHandler(new FocusChangedHandler() {
    
                @Override
                public void onFocusChanged(FocusChangedEvent event) {
                    if (!event.getHasFocus() && isEditting && valuesHaveChanged()) {
                         SC.ask("Title", "Save unsaved data?", new BooleanCallback() {
    
                            @Override
                            public void execute(Boolean value) {
                                if (value) {
                                    saveData();
                                    setReadOnly(true);
                                } else {
                                    setReadOnly(true);
                                }
                            }
                        });
                    }
                }
    
                ;
            });
        }
    I would really appreciate any help, as I don't really see a way out.

    #2
    Tried the same with GWT 2.3 ... IE 8 still won't work.

    Comment


      #3
      I know that probably no one is going to read that thread but I've found out that relying on focus handlers is far too risky. I've slightly misinterpreted the requirement and solved the situation using simpler approach.

      Comment

      Working...
      X