On 12/13/16, 1:21 PM, "[email protected] on behalf of Carlos Rovira"
<[email protected] on behalf of [email protected]> wrote:

>2016-12-12 6:24 GMT+01:00 Alex Harui <[email protected]>:
>
>> Would it be useful to have a component that generates a TextNode?  Then
>> you could interleave them between other child components.
>>
>
>Right, I was trying that and experimenting with the beadsAdded and
>initComplete listeners to see when
>the text is added when there's more nodes. I think that we could have a
>"insertLast" property in the bead or similar to let user decide if
>he want the text and the first and then nodes or nodes and the text... Or
>we could put a "index" property to decide where to insert...

IMO, if you had a TextNode component, it would be a child just like any
other child and you would define its order the way it should appear in the
DOM.

<js:Container>
  <js:TextNode>This is some text</js:TextNode>
  <js:Button />
  <js:TextNode>This is more text</js:TextNode>
</js:Container>

Would product the DOM
<div>This is some text<button />This is some more text</div>


>
>
>>
>> IMO, a Container is a general purpose container of child components.
>>Yes,
>> we currently use Div for it in HTML, but other platforms may have
>> different behavior.  It turns out that you can write to innerHTML to set
>> children and text/html in JS, but it isn't clear that a Container should
>> support a text/html property.  A Div component could, but again, I think
>> it should just accept children.  A DivForHTML component could expose an
>> innerHTML property and not subclass Container so that you can't add
>> children and conflict with the innerHTML property.
>>
>> Just thinking out loud...  I could be wrong,
>>
>
>Thinking loud as well, maybe InnerHTML is a "HTML only bead" since in a
>SWF
>scenario could not have sense?
>Don't have this very clear right now...

Everything you can do in HTML, we could eventually do in a SWF.  Probably
not right away though...

-Alex

Reply via email to