History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-15567
Type: Bug Bug
Status: Closed Closed
Resolution: Not a Bug
Assignee: Joan Lafferty
Reporter: Cosma Colanicchia
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Flex SDK

Container's scrollbars behavior is different when specifying size in percentage

Created: 05/14/08 10:03 AM   Updated: 05/16/08 04:50 PM
Component/s: Layout - General
Security Level: Public (All JIRA Users )

File Attachments: None
Image Attachments:

1. image 01.png
(3 kb)

2. image 02.png
(4 kb)

3. image 03.png
(4 kb)

Severity: Incorrectly Functioning
Reproducibility: Every Time
Discoverability: Medium
Found in Version: SDK Flex 3 (Released)
Affected OS(s): Windows - XP
Steps to Reproduce:
Consider the following MXML layout:

    <mx:VBox height="400" width="250" borderStyle="outset">
        <mx:Box height="50" width="100%" borderStyle="outset"/>
        <mx:VBox height="100%" width="100%" borderStyle="outset"
                verticalAlign="middle" horizontalAlign="center">
            <mx:Box height="250" width="50" borderStyle="inset"/>
        </mx:VBox>
    </mx:VBox>

It will produce the result shown in attached image 01. Now, let's suppose that the inner box expands its height, growing taller than its container:

    <mx:VBox height="400" width="250" borderStyle="outset">
        <mx:Box height="50" width="100%" borderStyle="outset"/>
        <mx:VBox height="100%" width="100%" borderStyle="outset"
                verticalAlign="middle" horizontalAlign="center">
            <mx:Box height="450" width="50" borderStyle="inset"/>
        </mx:VBox>
    </mx:VBox>

Some scrollbar has to appear.. and it does: see attached image 02. However, it is applied to the outer box. I can't find a way to have its immediate parent box show the scrollbar using percentage size... only specifying an
absolute size I can obtain this behavior:

    <mx:VBox height="400" width="250" borderStyle="outset">
        <mx:Box height="50" width="100%" borderStyle="outset"/>
        <mx:VBox height="330" width="100%" borderStyle="outset"
                verticalAlign="middle" horizontalAlign="center">
            <mx:Box height="450" width="50" borderStyle="inset"/>
        </mx:VBox>
    </mx:VBox>

The result is shown in attached image 03. IMO, applying a percentage size instead of an absolute one should not affect scrollbar behavior.

I'm not sure if this is really a bug - maybe a way does exist to layout components like this using percentage sizes, but I can't find it and documentation doesn't seem to cover this case.
Language Found: English
Bugbase Id: none
QA Owner: Joan Lafferty
Resolved by: Cosma Colanicchia
Confirmed Version: SDK Flex 3 (Released) - Next Build
Participants: Cosma Colanicchia and Joan Lafferty
Browser: Internet Explorer 6.x
JDK: Sun 1.6.x


 All   Comments      Sort Order:
Cosma Colanicchia - [05/14/08 11:36 AM ]
Ok, this is not a bug - you have to set the minHeight of the container element to 0.

There is a post on flexcoders on a similar issue:
http://tech.groups.yahoo.com/group/flexcoders/message/77204?threaded=1&p=1

[...]
You can achieve that by setting minHeight and minWidth on the VBox to
0. By the default, the VBox's minHeight is the sum of all of its
children's measured heights (ditto for minWidth), and the VBox won't
resize to smaller than its minHeight, because the Application (which
is a VBox too) gives preference to minHeight over vertical the
constraints "top" and "bottom" (and percentage-based heights).
[...]

Joan Lafferty - [05/16/08 04:50 PM ]
Thanks for resolving this. Also, there is more info on how the layout manager does passes through the application to determine the size of everything:
http://livedocs.adobe.com/flex/3/html/help.html?content=size_position_2.html