Hi,
I added a list of choices using ListModelList to a ZK listbox. Next, I tried to loop through these list of choices and find a required item (say "String"). I need to set this item ("String") as the selected item.
I tried the code below but it doesn't work. Is there a way to do this ?
liveListModel = new ListModelList(new AppModelItem [] {
new AppModelItem("String", "string"),
new AppModelItem("Number", "number"),
new AppModelItem("Array", "array")
});
String choice [] = {"String", "Hello", "XYZ" };
Listbox typesList = new Listbox();
typesList.setModel(liveListModel);
for (int i = 0; i < choice.length; i ++) {
if (choice.[i] == typesList.getItemAtIndex(i).getValue().toString());
typesList.setSelectedItem(typesList.getItemAtIndex(i));
}
Thanks, Sony