Results 1 to 1 of 1

Thread: Accordion Layout does not work when it has other accordion layouts inside

Threaded View

Previous Post Previous Post   Next Post Next Post
    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext GWT Premium Member
    Join Date
    Jan 2012
    Posts
    17
    Vote Rating
    1
      0  

    Default Accordion Layout does not work when it has other accordion layouts inside

    Accordion Layout does not work when it has other accordion layouts inside. It is to say, if you want to create an accordion menu with embedded accordions to have a hierarchy, new widgets are no longer shown

    The recursive code to generate the accordion is:
    Code:
    public static Widget createMenuFromMenuModel(MenuModel menuModel) {
            ContentPanel panel = new ContentPanel();
            panel.setBodyBorder(false);
            panel.setPixelSize(200, 325);
    
    
            Widget widget = getMenuWidgetFromMenuModel(menuModel, null);
            panel.add(widget);
    
    
            VerticalPanel verticalPanel = new VerticalPanel();
            verticalPanel.setSpacing(10);
            verticalPanel.add(panel);
            return verticalPanel;
    
    
        }
    
    
        private static Widget getMenuWidgetFromMenuModel(MenuModel menuModel,
                AccordionLayoutContainer accordionLayoutContainer) {
            AccordionLayoutAppearance appearance = GWT
                    .<AccordionLayoutAppearance> create(AccordionLayoutAppearance.class);
            ContentPanel contentPanel = new ContentPanel(appearance);
            contentPanel.setAnimCollapse(false);
            contentPanel.setHeadingText(menuModel.getTitle());
            Widget widgetToReturn = contentPanel;
            if (menuModel.getListOfMenuModels().size() > 0) {
                accordionLayoutContainer = new AccordionLayoutContainer();
                accordionLayoutContainer.setFill(true);
                accordionLayoutContainer.add(contentPanel);
                accordionLayoutContainer.setWidget(contentPanel);
                VerticalPanel verticalPanel = new VerticalPanel();
                verticalPanel.setSpacing(10);
                contentPanel.add(verticalPanel);
                for (MenuModel currentMenuModel : menuModel.getListOfMenuModels()) {
                    Widget widget = getMenuWidgetFromMenuModel(currentMenuModel,
                            accordionLayoutContainer);
                    verticalPanel.add(widget);
                }
            } else {
                if (menuModel.getListOfOptionModel().size() > 0) {
                    VerticalPanel verticalPanel = new VerticalPanel();
                    verticalPanel.setSpacing(10);
                    contentPanel.add(verticalPanel);
                    accordionLayoutContainer.add(contentPanel);
                    for (OptionModel currentOptionModel : menuModel
                            .getListOfOptionModel()) {
                        TextButton textButton = new TextButton();
                        textButton.setTitle(currentOptionModel.getTitle());
                        verticalPanel.add(textButton);
                    }
                }
            }
            return widgetToReturn;
        }
    Attached Images Attached Images

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •