View Full Version : ExtJs tabs + EditArea exception

9 Jul 2010, 6:02 AM
Hello all,

I killed all the day trying to fix that and I still really don't know what is going on. I'm using EditArea code editor. I'm placing it on ExtJs TabPanel, every tab contains one TextArea with EditArea instance created on it. When I use one of the tabs everything is fine, but when I enter some text and switch between tabs I'm getting exception on firefox.

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLTextAreaElement.selectionStart]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: :: anonymous :: line 13" data: no]

there is no such exception on other browsers. I know that it is not actually extjs issue, but I don't know where else can I ask that question. Without extjs multiple instances of editarea works fine, might it be some kind of conflict or can it be in the result of handling some event when I switch the tabs?

Thanks in advance.

9 Jul 2010, 9:45 AM
Looks like I found the problem.
It seems that EditArea hides user-defined textarea and shows something else instead, but onblur it sets current value to user-defined textarea. When I switch between tabs it tries to set, but the tab is already hidden. What I did is

When I switch between tabs EditArea tries to set (onblur) focused one of items on my window in beforetabchange event handler, this could be a good workaround, but I don't have anything that is always visible on my window. All panels are collapsible and this trick doesn't work when those inputs are collapsed. What can you recommend?

9 Jul 2010, 10:07 AM
I've created TextArea with absolute layout and size(0, 0) positioned at (-10, -10) and called focus for that control in beforetabchange event handler.