1. #1
    Ext User
    Join Date
    Jun 2008
    Posts
    8
    Vote Rating
    0
    makados is on a distinguished road

      0  

    Default Scroll doesn't appear in the ContentPanel

    Scroll doesn't appear in the ContentPanel


    Hi there,
    I have wrapper on two other panels implemented as ContentPanel. One of my panels is Collapsible and appears collapsed. I want wrapper panel to show scroll when my panel is uncollapsed so user can find his needed components. And all of that are in the Dialog. Here is the code:
    Code:
    public class ContactDialog extends Dialog {
    public ContactDialog() {
            setModal(true);
            setResizable(true);
            setBodyBorder(false);
            setInsetBorder(false);
            setButtons(Dialog.OKCANCEL);
            setIconStyle("icon-app-side");
            setHeading(MCMessages.msg.cw_title_create());
            setWidth(GuiConstants.CONTACTWINDOW_WIDTH);
            setHeight(GuiConstants.CONTACTWINDOW_HEIGHT);
            setHideOnButtonClick(true);
            setLayout(new FillLayout());
            setScrollMode(Style.Scroll.ALWAYS);
    
            FormPanel formPanel = new FormPanel();
            formPanel.setLabelWidth(100);
            formPanel.setFieldWidth(-1);
            //formPanel.setIconStyle("icon-form");
            formPanel.setFrame(true);
            formPanel.setWidth(400);
            formPanel.setButtonAlign(Style.HorizontalAlignment.CENTER);
            formPanel.setHeading("form header");
    
            //some fields are added to formPanel
            
            final ContentPanel wrapperPanel = new ContentPanel(new RowLayout());
            wrapperPanel.setScrollMode(Style.Scroll.ALWAYS);
            wrapperPanel.setHeaderVisible(false);
            wrapperPanel.setFrame(true);
            add(wrapperPanel);
            wrapperPanel.add(formPanel);
    
            TableLayout tl = new TableLayout(2);
            final ContentPanel attrPanel = new ContentPanel();
            attrPanel.setCollapsible(true);
            attrPanel.collapse();
            attrPanel.setHeading("attr header");
            attrPanel.setLayout(tl);
            wrapperPanel.add(attrPanel);
    
            //some fields are added to attrPanel
    }

  2. #2
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    4
    gslender is on a distinguished road

      0  

    Default


    change the layout to FlowLayout at around line 13

  3. #3
    Ext User andrey's Avatar
    Join Date
    May 2008
    Location
    Boston
    Posts
    34
    Vote Rating
    0
    andrey is on a distinguished road

      0  

    Default I'm having the same problem with Beta5

    I'm having the same problem with Beta5


    Why should it make it a difference to change from FitLayout() to FlowLayout() when the scrollMode of the panel is set to AUTO or ALWAYS?

    Anyway, my app had a dialog which had a ContentPanel with a Table in it. With Beta5, the scrolling no longer works when the table's contents exceed the view area no matter if I use FlowLayout() or FitLayout(). So it seems this is a regression (sigh).

    - Andre

  4. #4
    Ext User andrey's Avatar
    Join Date
    May 2008
    Location
    Boston
    Posts
    34
    Vote Rating
    0
    andrey is on a distinguished road

      0  

    Default Requires FlowLayout() *plus* call to setScrollMode()

    Requires FlowLayout() *plus* call to setScrollMode()


    Whoops! I discovered that I was missing the call to ContentPanel.setScrollMode(Scroll.AUTO) in my code. I've done some testing and if I use the suggestion to use a FlowLayout instead of FitLayout combined with calling setScrollMode(AUTO), things work as expected. However, something seems to have changed in GXT from beta4 to beta5 and I still would like to understand why it only works with FlowLayout.

    As an aside, wouldn't it make sense for the default scroll mode to be AUTO instead of NONE?

    Thx,
    Andre

  5. #5
    Ext User
    Join Date
    Jun 2008
    Posts
    8
    Vote Rating
    0
    makados is on a distinguished road

      0  

    Default


    support setting default scroll mode to AUTO. And also support question why It works only with FlowLayout?

  6. #6
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    4
    gslender is on a distinguished road

      0  

    Default


    scrolling only makes sense for layouts that don't try to fill all available space - ie these layouts are trying to resize their children to be their container parents size - if the containing parent is scrollable, and the layout is FillLayout, then the child will always only be as big as the containing parent, never bigger (so no scroll bars)

    Flow layout lets children be as big as they need to, thus allowing scroll bars show when needed

Thread Participants: 2