Hi guys,
I realize that there are too many buttons on the page.
So I write the following logic and I try to hide some button inside the IMenuButton. However, when I click on the IMenuButton, no button has been shown.
May somebody can help with this issue? Thankssssss.
here is my code:
// buttonLayout is a HLayout and it has around 10 button members.
IMenuButton btnMenu = null;
if (buttonLayout.getMembersLength()>5) {
int lastIndex = buttonLayout.getMembersLength()-1;
Menu menu = new Menu();
for(int i = 4; lastIndex > i; lastIndex--) {
GWT.log("lastIndex : "+lastIndex);
IButton temp = new IButton();
temp = (IButton) buttonLayout.getMember(lastIndex);
GWT.log("temp "+temp);
GWT.log("buttonlayout "+buttonLayout.getMember(lastIndex));
menu.addMember(temp);
buttonLayout.removeMember(buttonLayout.getMember(lastIndex));
}
GWT.log("menu size : "+menu.getMembersLength());
btnMenu = new IMenuButton("More Buttons", menu);
buttonLayout.addMember(btnMenu);
}
I realize that there are too many buttons on the page.
So I write the following logic and I try to hide some button inside the IMenuButton. However, when I click on the IMenuButton, no button has been shown.
May somebody can help with this issue? Thankssssss.
here is my code:
// buttonLayout is a HLayout and it has around 10 button members.
IMenuButton btnMenu = null;
if (buttonLayout.getMembersLength()>5) {
int lastIndex = buttonLayout.getMembersLength()-1;
Menu menu = new Menu();
for(int i = 4; lastIndex > i; lastIndex--) {
GWT.log("lastIndex : "+lastIndex);
IButton temp = new IButton();
temp = (IButton) buttonLayout.getMember(lastIndex);
GWT.log("temp "+temp);
GWT.log("buttonlayout "+buttonLayout.getMember(lastIndex));
menu.addMember(temp);
buttonLayout.removeMember(buttonLayout.getMember(lastIndex));
}
GWT.log("menu size : "+menu.getMembersLength());
btnMenu = new IMenuButton("More Buttons", menu);
buttonLayout.addMember(btnMenu);
}
Comment