1

I'm having a rare issue in my code, I have a method that makes a very simple validation based on a string variable:

private void showNextStep(String psCondition,String poStepName){
    int liCurrentStep=Integer.valueOf(poStepName);
    String lsNextTrueStep=moSteps[liCurrentStep][4];
    String liNextFalseStep=moSteps[liCurrentStep][5];

    if ("Yes".equals(psCondition)){     
        moFrmStepsContainer.getField(liNextFalseStep).hide();
        moFrmStepsContainer.getField(lsNextTrueStep).show();            
    }else{           
        moFrmStepsContainer.getField(liNextFalseStep).show();
        moFrmStepsContainer.getField(lsNextTrueStep).hide();            
    }
}

Now, here is the ticky part: if I execute the application without debugging mode, it does the validation right all the time, how ever if don't it always goes to the else block (or at least I think) I tried to use JS alerts (I have a class that calls JS methods) to debug manually and check the valors of the variables; the valors where all right and the validation was also good. This means that only debugging or putting alerts before at the beggining of the IF block it does the validation right, otherwise it always goes to the ELSE, what do you think it could be?

It might be worth mentioning this is a web application made in netbeans 6.9, using the framework GWT 2.1. This application runs in firefox 25.0.1

Thank you!

UPDATE Here is the code of the event that calls my method

final ComboBoxItem loYesNo=new ComboBoxItem("cmbYesNo" + moSteps[liStepIndex][0],"");
 loYesNo.setValueMap("Yes","No");
 loYesNo.setVisible(false);
 loYesNo.setAttribute("parent", liStepIndex);
 loYesNo.addChangedHandler(new ChangedHandler() {
 public void onChanged(ChangedEvent poEvent){
     String lsStepName=loYesNo.getName();
     FormItem loItem=moFrmStepsContainer.getField(lsStepName);
     String liStepNumber=String.valueOf(loItem.getAttributeAsInt("parent"));
     showNextStep((String)poEvent.getItem().getValue(),liStepNumber);
                    }
                });
Ben
  • 2,235
  • 18
  • 17
HanselDoullery
  • 197
  • 3
  • 15

0 Answers0