Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

MenuItem.setEnabled(Boolean.FALSE) quesiton

$
0
0
SmartClient Version: v9.1p_2014-05-07/PowerEdition Deployment (built 2014-05-07)
GWT 2.6.0
IE-11

[CODE]
MenuItemIfFunction disableIfNotOwner = new MenuItemIfFunction() {
@Override
public boolean execute(Canvas target, Menu menu, MenuItem item) {
if(model.getView().getCreateByUserId() != user.getId())
return false;
else return true;
}
};
MenuItem saveView = new MenuItem("Save");
saveView.setIcon("menu/save.png");
saveView.addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() {

public void onClick(MenuItemClickEvent event) {
viewMediator.saveView();
}
});
saveView.setEnableIfCondition(disableIfNotOwner);
[CODE]

I have a MenuItem where I set a conditional enable function. When the condition is true, the MenuItem works. When the condition is false, the MenuItem is not selectable, however the text for the MenuItem still remains the same as if it were enabled. Shouldn't the title to the MenuItem be greyed out?

Is there another call I'm not aware of that greys out the MenuItem text?

Viewing all articles
Browse latest Browse all 4756

Trending Articles