This is still a little bit of a conundrum. Automatically setting
position:absolute when setting x and y (effectively left and top styles)
runs into several problems as you can imagine.

One issue is that you have to make sure the parent container's position is
either relative or absolute, otherwise the element is positioned on the
first item in the parent chain that has position relative or absolute.
This is why BasicLayout sets the host component's position if it isn't
already set.

I first encourage you to base any new components on Group and then add in
BasicLayout. Nothing will happen until you dispatch a layout needed event.
You should be able to add multiple children and then dispatch the event.

We could also make a specialized Group subclass that has a
positionElement(element, x, y) function that will also set
position:absolute. Perhaps we could call it "BasicGroup" that would also
make BasicLayout its default but you would not necessarily need to run the
layout every time.

Maybe there are some other ideas?

‹peter

On 4/25/17, 5:41 AM, "yishayw" <yishayj...@hotmail.com> wrote:

>Also, what if I'm adding elements to a UIBase (no layout)? Shouldn't I be
>able to set the absolute x and y on the added element?
>
>
>
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-development.2333347.n4.nabble.com%2FFlexJS-Layouts-tp61120p61330.html&da
>ta=02%7C01%7C%7Ce0b936af7e38411d815a08d48bc0c368%7Cfa7b1b5a7b34438794aed2c
>178decee1%7C0%7C0%7C636287107406338981&sdata=iY0A2%2FsLf%2BCVgWsNlxZl%2BBR
>C20YTFTjPuX3%2BulkUBss%3D&reserved=0
>Sent from the Apache Flex Development mailing list archive at Nabble.com.

Reply via email to