I created a dynamic table after receiving with hashmap. Previously I used json as input and javascript and I was able to pre-select radio buttons based on json input. However below code is not working neither for pre-selecting and when selecting the radio button only of all the radio buttons is being selected.
Please help, I am new to jsp and hashmap so pardon any syntax errors.
<tr align="left">
<td align="left"> <%out.println( tempsysDetails1.getCategory().get(i)); %> </td>
<td align="left"> <input type="radio" name="inlineRadioOptions_' + i + '[]" value="0" id="inlineRadio0"' +
(tempsysDetails1.getSystemStatus().get(i)) = 0 ? ' checked="checked"' : '' ) + '><font color="black">Grey  </font><label class="radio-inline">
<input type="radio" name="inlineRadioOptions_' + i + '[]" value="1" id="inlineRadio1"' + tempsysDetails1.getSystemStatus().get(i)) = 1 ? ' checked="checked"' : '') +
'><font color="green">Green  </font><label class="radio-inline"><input type="radio" name="inlineRadioOptions_' + i + '[]" + id="inlineRadio2" value="2"' +
(tempsysDetails1.getSystemStatus().get(i)) = 2 ? ' checked="checked"' : '' ) + '><font color="yellow">Yellow  </font></label><label class="radio-inline">
<input type="radio" name="inlineRadioOptions_' + i + '[]" id="inlineRadio3" value="3"' +
(tempsysDetails1.getSystemStatus().get(i)) = 3 ? ' checked="checked"' : '') + '> <font color="red">Red</font></label></td>
<td align="left"><input type="text" id= "comments[i]" class="form-control name_list" placeholder="<%out.println( tempsysDetails1.getComments().get(i)); %> "> </td>
</tr>
Attaching screenshot for reference: