I want to pre populate check boxes on jsp. I have following code on my Mycheckbox.jsp
Code
MyDTO [] dtoArr = Context.getParameter("PREFdtoSettings");
<%=dtoArr.length%> is 6;
dtoArr[i].getId(); gives me the unique ID;
In above code am setting PREFdtoSettings parameter in request context in handler class
There are almost 100 checkboxes on the page as shown in the code
CheckBox No.1
`<input type=”checkbox” id=”dtoArr[i].getid()”> FXX </input>`
Similarly, I am having 100 checkbox which has unique id and that id information am getting by id=”dtoArr[i].getid()”.
Now, I want to pre populate the 6 checkboxes by matching dtoArr[i].getid() among 100 existing checkboxes on the pageload but I am not sure how I can achieve this.
I was going through some blogs and it suggested that I should create JSON Object of dtoArr and use my JSON in my javascript DOJO but I am not sure how can I implement it.
Any suggestions or input would be highly appreciated.
Thanks.