Hybrid View

    You found a bug! We've classified it as EXTGWT-2590 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    134
    Vote Rating
    1
    bluemartini is on a distinguished road

      0  

    Default PaggingToolBar additional menu hanging after browser is maximized.

    PaggingToolBar additional menu hanging after browser is maximized.


    Hi,

    We have facing issue with PagingToolBar additional menu. To be clear, additional menu is a menu which appears if toolbar size is reduced, to display the widgets as menu item.

    Steps to reproduce the issue:

    1. Create BorderLayoutContainer. Set the paging toolbar(Use the attached derived class CusPagingToolBar.java) in the nort position.
    2. Add the created BorderLayoutContainer to the ViewPort. When you run the application you see the PagingToolBar. Please find the screen shot2.
    3. Minimize the browser to the size to get the additional menu at right of the PaggingToolBar.Please find the screen shot2.
    4. Now click on the additional menu button, where you find the drop down containg navigation buttons. Please find the screen shot2.
    5. Now maximize the browser. You will still find the additional menu is hanging in middle. Which should have been removed. Please find the screen shot3.


    As part of investigation identified that there is no action taken to hide the additional menu in method onOverflow() in HBoxLayoutContainer.java.

    Code:
        protected void onOverflow() {
         
            // Some code exist here
    
             if (hiddens != null && hiddens.size() > 0) {
                 initMore();
             }        
    
             // Some code exist here
         }
    Our Analysis:
    When browser is maximized all the widgets in toolbar can be visible. So, not required to hide the widget as a result collection hiddens size will be
    zero. If hiddens.size() is zero if we hide the moreMenu that will fix the issue. Please let us know our analysis is valid or not. We cross checked in GXT2 code where the same is implemented.

    Details from the file ToolBarLayout.java:
    Code:
         protected void fitToSize(El t) {
        
            if (hiddens != null && hiddens.size() > 0) {
                initMore();
                if (!lastOverflow) {
                    lastOverflow = true;
                }
            } else if (more != null) {
                ComponentHelper.doDetach(more);
                more.el().removeFromParent();
                if (lastOverflow) {
                    lastOverflow = false;
                }
            }
        }
    Please find the java files created to reproduce the issue.

    Code:
    public class ToolBarExample implements IsWidget, EntryPoint {
    
        private CusPagingToolBar cusPagingToolbar = new CusPagingToolBar(10);
        
        @Override
        public Widget asWidget() {
            Viewport viewport = new Viewport();
            
            BorderLayoutData northData = new BorderLayoutData(30); 
            northData.setCollapsible(false);
            
            BorderLayoutContainer borderLayoutContainer = new BorderLayoutContainer();
            
            cusPagingToolbar.removeDisplayLabel();
            borderLayoutContainer.setNorthWidget(cusPagingToolbar,northData);
            
            viewport.add(borderLayoutContainer, new MarginData(10,30,30,10));
            return viewport;
        }
    
        public void onModuleLoad() {
            RootPanel.get().add(asWidget());
        }
    }
    Code:
    public class CusPagingToolBar extends PagingToolBar {
    
        public CusPagingToolBar(int pageSize) {
            super(pageSize);
            
            final TextButton item1 = new TextButton("Button w\\ Menu");
    
            SelectionHandler<Item> handler2 = new SelectionHandler<Item>() {
                @Override
                public void onSelection(SelectionEvent<Item> event) {
                    MenuItem item = (MenuItem) event.getSelectedItem();
                    item1.setText("He Liked"+item.getText());
                    forceLayout();
                }
            };
    
            Menu menu = new Menu();
            menu.addSelectionHandler(handler2);
    
            CheckMenuItem menuItem = new CheckMenuItem("I Like Cats");
            menuItem.setChecked(false);
            menu.add(menuItem);
    
            menuItem = new CheckMenuItem("I Like Dogs");
            menu.add(menuItem);
            item1.setMenu(menu);
    
            menu.add(new SeparatorMenuItem());
    
            this.insert(item1, 0);
    
            this.insert(new SeparatorToolItem(), 1);
    
            SplitButton splitItem = new SplitButton("Split Button");
            //splitItem.setIcon(Resources.IMAGES.list_items());
    
            menu = new Menu();
    
            MenuItem item = new MenuItem();
            item.setHTML("<b>Bold</b>");
            menu.add(item);
    
            item = new MenuItem();
            item.setHTML("<i>Italic</i>");
            menu.add(item);
    
            item = new MenuItem();
            item.setHTML("<u>Underline</u>");
            menu.add(item);
    
            splitItem.setMenu(menu);
    
            this.insert(splitItem, 2);
    
            this.insert(new SeparatorToolItem(), 3);
    
            this.insert(new FillToolItem(), 4);
        }
    
        public void removeDisplayLabel() {
    
            int size = getChildren().size();
            remove(size - 1);
            size = getChildren().size();
            remove(size - 1);
    
        }
    }
    Thanks and Regards.ScreenShot1.jpgScreenShot2.jpgScreenShot3.jpgScreenShot3.jpgScreenShot3.jpg

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Thanks for the report. I will move this thread to the bugs forum so we can take a look at it.

Thread Participants: 1