-
22 Mar 2012 12:59 AM #1
[GXT 2.2.5] NPE in Checkbox
[GXT 2.2.5] NPE in Checkbox
To reproduce add a checkbox with box label null to a panel.Code:at com.extjs.gxt.ui.client.widget.form.CheckBox.setBoxLabel(CheckBox.java:116)
If after rendering the lable is changed the NPE is thrown as boxLabelEl is null.
as of:Code:public void setBoxLabel(String boxLabel) { this.boxLabel = boxLabel; if (rendered) { boxLabelEl.update(getBoxLabel()); } }
Code:@Override protected void onRender(Element target, int index) { ... if (boxLabel != null) { boxLabelEl = new El(DOM.createLabel()); ... } ... }
-
22 Mar 2012 3:15 AM #2
As workaround you should use setBoxLabel("") initially.
-
22 Mar 2012 5:16 AM #3
Hello Sven,
thanks again for your fast reply.
In some cases box labels have to be null. For empty Strings the onRender method adds a label Element to the dom. My workaround overrides the CheckBox#setBoxLabel(String) Method. As in onRender my method adds or removes the label element from the dom depending on the old and new box label.
Greetings Nico.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote