Skip to main content
February 26, 2009
Answered

Datagrid in inlinegraphic element

  • February 26, 2009
  • 7 replies
  • 1803 views
Since i heard about tlf, i dreamt about a wysiwyg editor with chart and datagrid integrate for some cms devellopement, unfortunally i don't find a proper way to add datagrid in a inlinegraphic element.

i tried to use the SimpleEditor exemple provided with the flex3.2 exemple, and it's doesn't work, when i "updateAllContainer" i get some strange error like "list have reach the maximum index".
I guess i haven't understand something correctly, could someone give me an explanation ? :P

Thanks for answer
This topic has been closed for replies.
Correct answer
@Fdecampredon

I had similar thoughts a while back and attempted to do something similar to what you are thinking, in regards to creating a special container for flex objects. I created that special container class and was able to get Flex components to render inside of InlineGraphicElements. Rich is correct that TextLine will be the eventual parent of the Flex component that you might specify as the source of the InlineGraphicElement.

I had success with this by extending the Sprite class and then overriding addChild/removeChild, adding all of the logic from the UIComponent class in the Flex Framework, which is where heavy lifting is done for initializing Flex components when they are added to the display list. Includes things like calling createChildren() and setting the document property, etc. Ended up being about 400 lines worth of code.

That said, even though I was able to render the flex components inline with the text document, it was difficult to manage the size of the inline graphic element relative to the size of the flex component. In addition, mouse/keyboard interactivity is tough to preserve inside of your flex components because of how TLF is handling that stuff for editing.

Anyway, I just wanted to confirm that it *is* possible to do what you are suggesting, but it does take some work and trial/error to get it up and running.

Good luck!
Brent

7 replies

March 4, 2009
Thank you a lot MoJazzDJ i'll try to do the same :).
Adobe Employee
March 2, 2009
That's a Flex question. TLF team hasn't tried to do anything like that.
Correct answer
March 2, 2009
@Fdecampredon

I had similar thoughts a while back and attempted to do something similar to what you are thinking, in regards to creating a special container for flex objects. I created that special container class and was able to get Flex components to render inside of InlineGraphicElements. Rich is correct that TextLine will be the eventual parent of the Flex component that you might specify as the source of the InlineGraphicElement.

I had success with this by extending the Sprite class and then overriding addChild/removeChild, adding all of the logic from the UIComponent class in the Flex Framework, which is where heavy lifting is done for initializing Flex components when they are added to the display list. Includes things like calling createChildren() and setting the document property, etc. Ended up being about 400 lines worth of code.

That said, even though I was able to render the flex components inline with the text document, it was difficult to manage the size of the inline graphic element relative to the size of the flex component. In addition, mouse/keyboard interactivity is tough to preserve inside of your flex components because of how TLF is handling that stuff for editing.

Anyway, I just wanted to confirm that it *is* possible to do what you are suggesting, but it does take some work and trial/error to get it up and running.

Good luck!
Brent
Participant
March 26, 2009
Can you please send a sample code to insert a display object in the inlineGraphicElementt

Regards

Varun Rathore
March 2, 2009
Yeah after some test it seems that's not rly usefull, but could there not be a way to make a special container wich extend display object and wich will emulate the fonctionement of Flex Container class ?
For exemple by overriding addChild like UIComponent does ?
Adobe Employee
March 2, 2009
The problem isn't that InlineGraphicElement doesn't implement IUIComponent. The issue is that InlineGraphicElement.graphic is composed into a TextLine and thus has a parent of TextLine.

I think what you would need to do is assign a graphic to InlineGraphicElement.graphic that works with a Flex object as a child and a TextLine as a parent.
March 1, 2009
Thx a lot for answer, hm perhaps if i try to extend inlineGraphicElement with a correct implementation of IUIComponent i could add some flex object ? or that is completly silly :p ?
Adobe Employee
February 26, 2009
A Flex object needs to be hosted by another Flex object -- they don't tend to behave properly when added as rawChildren because they don't get hooked up to the Flex LayoutManager as Flex expects. So I would not expect that taking any Flex object, DataGrid, Button or whatever and making it an inline graphic would work properly.

I agree with you that it would be very cool if it could. I suggest posting that request to a Flex forum.

If you are having a problem with a non-Flex based DisplayObject as an inline graphic, that may be a bug on our side -- just give us the error & description of what is going wrong.

Thanks!

- robin
Adobe Employee
February 26, 2009
What's the exact error message? There aren't any maximum index checks in TLF code.