[CLOSED] TextArea client side events IE8 problem

  1. #1

    [CLOSED] TextArea client side events IE8 problem

    Hi,

    I have a TextArea control on the page where I'd like to listen for any client events associated with text changing. Here's the markup:

                                                <ext:TextArea ID="TextArea1" runat="server" DataIndex="Comments" AutoScroll="false">
                                                    <Listeners>
                                                        <SpecialKey Handler="if (e.getKey() === e.BACKSPACE) {
                                                                                if(!this.readOnly) {
                                                                                    enableButtons(true);
                                                                                }
                                                                                else {
                                                                                    e.preventDefault();
                                                                                }
                                                                            }" />
                                                        <AfterRender Handler="this.el.dom.setAttribute('onKeydown','if(!this.readOnly){enableButtons(true);}');
                                                                            this.el.dom.setAttribute('onPaste','if(!this.readOnly){enableButtons(true);}');
                                                                            this.el.dom.setAttribute('onDrop','if(!this.readOnly){enableButtons(true);}');" />
                                                    </Listeners>
                                                </ext:TextArea>
    This works fine in IE9 but not in IE8. Could you suggest a workaround or a different solution to meet the requirements such that it becomes browser agnostic?

    Thanks,

    Vadym
    Last edited by Daniil; Jun 27, 2012 at 12:51 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please clarify what exactly doesn't work in IE8?

    The "onKeyDown" attribute I would replace with the KeyDown listener.
    <ext:TextArea runat="server" EnableKeyEvents="true">
        <Listeners>
            <KeyDown Handler="console.log('KeyDown');" />
        </Listeners>
    </ext:TextArea>
  3. #3
    SpecialKey listener works fine in IE8, the rest doesn't. KeyDown listener doesn't fire either. All works well in IE9.

    Thanks,

    Vadym
  4. #4
    I have no native IE8 and test with IE9 in IE8 mode and IETester. Generally, the behavior might be different. But KeyDown and onPaste works for me and, as far as I can understand they also should work for native IE8. You could also try KeyPress instead of KeyDown.

    And I am not sure how to initiate the onDrop event. In other browsers I just select some text somewhere and drag/drop in to the TextArea. But, seems, I can do that in my IE.

    I suspect that IE8 might not support the onDrop attribute.
  5. #5
    Quote Originally Posted by Daniil View Post
    I have no native IE8 and test with IE9 in IE8 mode and IETester. Generally, the behavior might be different. But KeyDown and onPaste works for me and, as far as I can understand they also should work for native IE8. You could also try KeyPress instead of KeyDown.

    And I am not sure how to initiate the onDrop event. In other browsers I just select some text somewhere and drag/drop in to the TextArea. But, seems, I can do that in my IE.

    I suspect that IE8 might not support the onDrop attribute.
    TextArea controls behave pretty erratically for us. Lately I've discovered that they don't even render properly (please refer to the screenshot) on some machines having IE9 with the same build and revision as my development box. In that case, no listeners are working at all. If you could suggest anything to help alleviate the problem, that would be greatly appreciated.

    Thanks,

    Vadym
    Attached Thumbnails Click image for larger version. 

Name:	TextArea Display Problem.png 
Views:	97 
Size:	4.4 KB 
ID:	4406  
  6. #6
    Are there any non standard IE mode (compatibility, IE8, IE7) switched on these different machines? If yes, please switch off an re-test. These modes are officially not supported.

    If the issue still persists, it would be best to provide us with a sample to reproduce. We would be happy to investigate.
  7. #7
    Quote Originally Posted by Daniil View Post
    Are there any non standard IE mode (compatibility, IE8, IE7) switched on these different machines? If yes, please switch off an re-test. These modes are officially not supported.

    If the issue still persists, it would be best to provide us with a sample to reproduce. We would be happy to investigate.
    Many thanks for the insight, that saved my eve! Compatibility view was on by default for all Intranet sites. Once unchecked, the issue "magically" disappeared and the listener handlers got back to work :)

    Thanks,

    Vadym
  8. #8
    Yes, the IE compatibility modes are very capricious.

    Can we mark the thread as closed?
  9. #9
    Quote Originally Posted by Daniil View Post
    Yes, the IE compatibility modes are very capricious.

    Can we mark the thread as closed?
    Please do.

    Thanks,

    Vadym

Similar Threads

  1. Problem in Enable panel on client side
    By Rupesh in forum 1.x Help
    Replies: 1
    Last Post: Dec 15, 2010, 2:44 PM
  2. [CLOSED] NumberField set client Events server side
    By majestic in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 05, 2010, 10:03 AM
  3. Replies: 1
    Last Post: Dec 01, 2010, 5:14 PM
  4. Replies: 4
    Last Post: Mar 19, 2010, 11:35 AM
  5. Replies: 0
    Last Post: Sep 17, 2009, 8:04 AM

Tags for this Thread

Posting Permissions