View Full Version : [FIXED] CheckMenuItem still fires BeforeCheckChange event when events are suppressed

Adam Ward
22 Apr 2009, 1:00 PM
Simply look at the following method in CheckMenuItem:

public void setChecked(boolean state, boolean supressEvent) {
if (!rendered) {
this.checked = state;
MenuEvent me = new MenuEvent(parentMenu);
me.item = this;
if (fireEvent(Events.BeforeCheckChange, me)) {
if (el().getParent() != null) {
el().getParent().setStyleName("x-menu-item-checked", state);
checked = state;
if (!supressEvent) {
fireEvent(Events.CheckChange, me);

The BeforeCheckChange event is fired regardless of the value of supressEvent. It seems to me that ALL change events should be supressed if suppressEvent equals false. Unfortunately, this cannot be fixed by extending the class because the "checked" variable is private instead of protected.

Let me know if you need any additional information, I'm glad to help!

28 Apr 2009, 3:14 AM
Fixed in SVN.