PDA

View Full Version : bug in checkbox when it render to Menu



Love Yao
23 Dec 2009, 12:14 AM
//CheckBoxGroup
CheckBoxGroup checkBoxGroup = new CheckBoxGroup();
checkBoxGroup.setFieldLabel("music");
for (int i = 0; i < 1; i++) {
CheckBox checkBox = new CheckBox();

checkBox.setEnabled(true);
checkBox.setValue(true);
checkBox.setBoxLabel("No." i );
checkBoxGroup.add(checkBox);

}
//FormPanel
FormPanel formPanel = new FormPanel();
formPanel.add(checkBoxGroup);
//menu
Menu menu = new Menu();
menu.setWidth(300);
menu.add(formPanel);

button.setMenu(menu);


then the checkbox can not be select or Unselect

sven
24 Dec 2009, 1:43 AM
There is no need for double posting the exactly same post in multiply forums. Merging them and deleted the duplicate

Arno.Nyhm
28 Dec 2009, 9:26 AM
i think there is an error in your code.

i try your example and i can select the checkboxes...

please try to make a better standalone example!

Tested with GXT 2.1 and GWT 1.7

18012





package com.mycompany.myapplication.client.forumsnippets;

import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.menu.Menu;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

/**
*
* @author
*/
public class ForumThread421610CheckboxNotSelectable implements EntryPoint {

public void onModuleLoad() {
showWindow();
}

private void showWindow() {
ContentPanel contentPanel = new ContentPanel();

//CheckBoxGroup
CheckBoxGroup checkBoxGroup = new CheckBoxGroup();
checkBoxGroup.setFieldLabel("music");
for (int i = 0; i < 3; i++) {
CheckBox checkBox = new CheckBox();

checkBox.setEnabled(true);
checkBox.setValue(true);
checkBox.setBoxLabel("No." + i);
checkBoxGroup.add(checkBox);

}
//FormPanel
FormPanel formPanel = new FormPanel();
formPanel.add(checkBoxGroup);
//menu
Menu menu = new Menu();
menu.setWidth(300);
menu.add(formPanel);

Button button = new Button("abc");
button.setMenu(menu);

contentPanel.add(button);

RootPanel.get().add(contentPanel);
}
}

Love Yao
29 Dec 2009, 11:21 PM
no !
the same code as yours,but the checkboxes will not work.

GWT1.7+GXT2.1 as same as yours, In IE7.0,Chrome,FF.

Arno.Nyhm
30 Dec 2009, 2:46 AM
i tested it in FF 3.5.6 and in IE 8

and i can select and unselect the checkboxes.

did you look into it with firebug? maybe some custom css settings or a wrong css file making problems?

sven
30 Dec 2009, 2:46 AM
It is an IE7 only problem and was already reported before and will be fixed with the next release.