PDA

View Full Version : HtmlEditor in a CardLayout in a Window



KampfCaspar
30 Nov 2007, 2:07 PM
Hi!

All I try, deferredRender on or off, I seem to be unable to set up a HtmlEditor field on a (non-default) pane of a CardLayout in a Window... Firefox and IE error:

-- firefox 2
[Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMNSHTMLDocument.designMode]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://server/ext/ext-all-debug.js :: anonymous :: line 27884" data: no]
this.doc.designMode = 'on';

-- ie7
Line: 27917
Char: 17
Error: Invalid Argument
Code: 0

Is it possible to get one (or more) HtmlEditors without workarounds like attaching the editor upon panel rendering?

Please find attached a minimized version of what I try (buttons for panel change removed).

phillroberts
30 Nov 2007, 2:19 PM
Sounds similar to a problem I just had...except that mine involved the TabPanel...
The TabPanel is based on the CardLayout, so the same hack/fix/solution may work for you...

The solution involves manually rendering the component and activating the tab/card/whatever, so that the htmleditor gets rendered. The htmleditor will render automatically when the card is active.

Also, the deferredRender didn't work for me either...and others...I got a similar error, so don't feel bad :-)

See this thread for the solution I used: http://extjs.com/forum/showthread.php?t=19640

KampfCaspar
30 Nov 2007, 5:02 PM
Thanks for your answer!

However - bad me - I don't understand your solution. My firefox "fails" the moment the window is rendered (by calling show or render) - even if I add deferredRender to any and all object definitions :(

With your solution, I am therefore unable to "activate" different panels, as the 'bail out' happens before (at the render to body).

What am I missing from your (greatly appreciated) solution?

santosh.rajan
30 Nov 2007, 7:59 PM
Just check this. HtmlEditor needs quicktips initialised to work, needs
Ext.QuickTips.init(); at the beginning of your program.

KampfCaspar
1 Dec 2007, 4:27 AM
Yes, I enabled Quicktips - after getting a different error.

As FF shows the erroring line, I suppose there is a problem activating designmode in a "hidden" panel. (it works, if the htmleditor is on the 'active' panel)

The 'obvious' solution would be to enable deferredRender - as I did. For a reason unknown to me, the htmleditor is still rendered immediately, rather than 'deferred' at the moment of activating the panel.

KampfCaspar
1 Dec 2007, 6:45 AM
Looking through sources and debugging, it seems that 'deferredRender' is not applied to ContainerLayouts within CardLayouts?!

If I add the htmlEditor as one card w/o embedding it in a CardLayout, the rendering process works fine. (although the card changeing does no more).

If - as it seems "correct" to me - I embed htmlEditor in a Panel/Layout, that 'embedded' layout gets rendered immediately. Independent of 'deferredRender' :(

Is it me or is that behaviour incorrect?