Skip to main content
Participant
January 26, 2009
Answered

Grouping elements

  • January 26, 2009
  • 1 reply
  • 696 views
Hello,
I need help with a problem. I have some groups of text. For example ("HELLO", "HOW ARE YOU", "FINE"). I need to show them as if they were only one big text ("HELLO HOW ARE YOU FINE"), but at all times I need to know which one is selected, modified, the new text, the format (it can be changed), etc.

I did this with a TextField using a separator char (making it invisible), but it didn't work very well (and also there were problems with the images). So I decided to try this framework. My idea was to use a GroupElement for each text (Like DivElement). I can have one textFlow with all the text, but at all times I can see which DivElement is selected.
However, this approach has a problem, I need to have:
- Groups that have more than one paragraph. (<div><p>Paragraph 1</p><p>Paragraph 2</p></div>) and
- Several groups in one paragraph (<p><div>Group 1</div><div>Group 2</div></p> )

A DivElement can't be a child of a ParagraphElement. Also, if you use 2 DivElements, you get 2 paragraph (not what I need for the second case).
Is there a way to do this? maybe extending a class?

Thank you very much,
Martin
This topic has been closed for replies.
Correct answer rdermer
I think what you want to do is make them each spans in a single paragraph. With the more recent TLF builds all FlowElements including SpanElement support the id property. Give each SpanElement a unique id and they won't merge. Should work in markup as well.

1 reply

rdermerCorrect answer
Adobe Employee
January 26, 2009
I think what you want to do is make them each spans in a single paragraph. With the more recent TLF builds all FlowElements including SpanElement support the id property. Give each SpanElement a unique id and they won't merge. Should work in markup as well.
brian_thomas2
Adobe Employee
Adobe Employee
January 28, 2009
Recent TLF builds can be found in the latest build of Gumbo. See the SWCs in the Gumbo Repository.
Participant
February 2, 2009
Thanks for answering.
The problem with using SpanElements to group is that if I change the formatting of a part of the text, the framework will create two or three different Spans.
for example:
1) <span>HELLO WORLD</span>
2) I select "WO" and make it italic
3) I get <span>HELLO </span><span fontStyle="italic">WO</span><span>RLD</span>

If I set an ID to the spanElement (for example: "span1") and then change the formatting, will the new SpanElements have the same ID? I need to keep them as one group/unit even if parts of the text have different formats. That´s why I wanted to use an element to group the Spans.

Another question: Where can I find the API Reference for recent TLF builds?

Thank you!
Martin