This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi I am using the following code to generate a mulibox values:
interestsForm looks like that:
I need to display some of the values as checked. I will depent it on the data base that I will return in String all the interests that the user alreay has. I thought to create another variable: private String checkedItems = ... // i will get it from DB; and if the itme is in the checkedItems - it will display checked next to it.
As per above code - you should have two properties in your form/bean. One is items and second one is selectedItems. if any Item from selectedItems is present inside items that check box will apear as checked else not.