[resolved] tMsgBox type question, error when clic on cancel button
Hi, I'm using tMsgBox (button Question : Ok, Cancel) on TOS v5.0.1 and I would like to test the user's choice (which button was used). My job is composed by 3 tMsgBox, one for the user's choice and 2 for testing choice (RunIf condition : ((String)globalMap.get("tMsgBox_1_RESULT")).equals("0") and !((String)globalMap.get("tMsgBox_1_RESULT")).equals("0"))
When I'm click on the cancel button, I have this error : connecting to socket on port 3971 connected Exception in component tMsgBox_1 java.lang.NullPointerException at repli_kdi_mysql_vm.tests_msgbox_0_1.tests_msgbox.tMsgBox_1Process(tests_msgbox.java:299) at repli_kdi_mysql_vm.tests_msgbox_0_1.tests_msgbox.runJobInTOS(tests_msgbox.java:679) at repli_kdi_mysql_vm.tests_msgbox_0_1.tests_msgbox.main(tests_msgbox.java:550) disconnected See my screenshot for details. Thank's in advance. Regards
Hi, Since you click cancel the result will be no object. Therefor your if conditions run into error because ((String)globalMap.get("tMsgBox_1_RESULT")) is no object. You could use "0".equals(((String)globalMap.get("tMsgBox_1_RESULT"))) and !"0".equals(((String)globalMap.get("tMsgBox_1_RESULT"))) instead. Regards, Arno