DEV Community

onurnalbantoglu
onurnalbantoglu

Posted on

I keep getting "null" errors

I have such a code. I'm working on a multiple selection and want it to show the values ​​entered. I also write in html to show them on the screen. However, whenever I make multiple selections, it brings up "null" first.

obj.load("REF_TEKLIF_NO");

Object value= obj .get("REF_TEKLIF_NO");

if (value instanceof Object[]) {

     Object values[] = (Object[]) value;

     for(int vv=0; vv < values.length; vv++)

     {

           REF_TEKLIF_NO =  REF_TEKLIF_NO + (vv == 0 ? "" : ", ") +  (java.lang.String) values[vv];

     }

} else {

           REF_TEKLIF_NO = (java.lang.String) value;

}

Top comments (1)

Collapse
 
erellsworth profile image
Edward Ellsworth

You have this tagged JavaScript but it looks more like Java. Is it supposed to be JavaScript?