Results 1 to 3 of 3

Thread: [GXT 2.2.5] NPE in Checkbox

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    11
    Vote Rating
    0
      0  

    Default [GXT 2.2.5] NPE in Checkbox

    Code:
    at com.extjs.gxt.ui.client.widget.form.CheckBox.setBoxLabel(CheckBox.java:116)
    To reproduce add a checkbox with box label null to a panel.
    If after rendering the lable is changed the NPE is thrown as boxLabelEl is null.

    Code:
    public void setBoxLabel(String boxLabel) {    this.boxLabel = boxLabel;
        if (rendered) {
          boxLabelEl.update(getBoxLabel());
        }
      }
    as of:

    Code:
    @Override  protected void onRender(Element target, int index) {
        ...
        if (boxLabel != null) {
          boxLabelEl = new El(DOM.createLabel());
          ...
        }
    ...
      }

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    132
      0  

    Default

    As workaround you should use setBoxLabel("") initially.

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    11
    Vote Rating
    0
      0  

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •