Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Oct 2009
    Posts
    26
    Vote Rating
    0
    baczek00 is on a distinguished road

      0  

    Default CheckColumnConfig bug please help

    CheckColumnConfig bug please help


    Hi all,

    I have this code

    Code:
    CheckColumnConfig checked = new CheckColumnConfig(ColumnDatabaseName,
                    ColumnName, ColumnSize) {
                @Override
                protected String getCheckState(ModelData model, String property,
                        int rowIndex, int colIndex) {
                    String s = (String) model.get(property).toString();
                    String r = "";
                    if (s == "1") {
                        r = "-on";
                    } else {
                        r = "-disabled";
                    }
                    MessageBox.info(s + " (Length: "+Integer.toString(s.length())+")", r, null);
                    return r;
                }
            };
            return checked;
    }
    Why is my statement "if" shows that the variable "r" is equal to "-disabled" when it is not true as seen in the attached picture?bug.png
    Regards
    Baczek00

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    if (s == "1") {
    This will never be true. Try to change it to "1".equals(s)

  3. #3
    Sencha User
    Join Date
    Oct 2009
    Posts
    26
    Vote Rating
    0
    baczek00 is on a distinguished road

      0  

    Default


    Thank you,
    You're right.
    Regards
    Baczek00

Thread Participants: 1

Tags for this Thread