Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • Bug Report : IMenuButton.setShowMenuBelow function not working

    Hi guys,

    I try to show the menu content above the menu button but I have found some unknown error :

    This is the first time I click the button, everything seem fine.

    Click image for larger version  Name:	MenuBug01.png Views:	1 Size:	9.7 KB ID:	256465

    This is the second time I click the button, the menu content is showing below the button and it reach the end of the page. It seems that the value of "ShowMenuBelow" is true.
    Click image for larger version  Name:	MenuBug02.png Views:	1 Size:	7.9 KB ID:	256466

    This is my code

    I first have a class "BasePage" extending com.smartgwt.client.widgets.Window, then I have a class "DetailPage" that is extending BasePage, at DetailPage I will check the user right for deciding to hide some of the buttons, then I will put those buttons into a HLayout and finally I will call the following method in BasePage.

    public HLayout combineButton(HLayout buttonLayout) {

    if (buttonLayout.getMembersLength()>5) {

    int lastIndex = buttonLayout.getMembersLength()-1;

    Menu menu = new Menu();

    for(int i = 4; lastIndex > i; lastIndex--) {

    HStack editButtons = new HStack(1);
    editButtons.setMembers(buttonLayout.getMember(lastIndex));

    editButtons.setWidth(100);
    editButtons.setAutoHeight();

    MenuItem editMenuItem = new MenuItem("");

    editMenuItem.setShowRollOver(false);
    editMenuItem.setEmbeddedComponent(editButtons);

    menu.addItem(editMenuItem);
    buttonLayout.removeMember(buttonLayout.getMember(lastIndex));

    }

    menu.setWidth(100);
    menu.setAutoHeight();
    menu.setCellHeight(30);

    IMenuButton btnMenu = new IMenuButton("More Buttons", menu);
    btnMenu.setShowMenuBelow(false);

    btnMenu.setWidth(110);
    buttonLayout.addMember(btnMenu);

    }
    else {
    return buttonLayout;
    }


    return buttonLayout;

    }

    The IMenuButton is generate at BasePage class so I can't set an onclicklistener to it , something like

    IMenuButton btnMenu = new IMenuButton("More Buttons", menu);
    btnMenu.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
    btnMenu.setShowMenuBelow(false);
    }
    });

    Can anyone help with this problem? Thanksssssss
    Last edited by lst0892; 10th Jan 2019, 00:31.
Working...
X