i have successfully made list view which contains contact list with check boxws. now the prob is i have to get checkbox field data but null is coming. Can u pls suggest me where i am doing mistake? Code snippet is: Updated: i got field data the updated code is below
private Vector _listData = new Vector();
private ListField listField;
private ContactList blackBerryContactList;
private Vector blackBerryContacts;
public static StringBuffer sbi = new StringBuffer();
VerticalFieldManager checkBoxGroup = new VerticalFieldManager();
CheckboxField cb;
//Constructor
CheckboxListField() {
listField = new ListField();
listField.setCallback(this);
reloadContactList();
for(int count = 0; count < blackBerryContacts.size(); ++count)
{
BlackBerryContact item =
(BlackBerryContact)blackBerryContacts.elementAt(count);
String displayName = getDisplayName(item);
CheckboxField cb = new CheckboxField(displayName, false);
cb.setChangeListener(this);
add(cb);
add(new RichTextField(cb.getLabel()));
}
add(new RichTextField(checkBoxGroup.toString()));
blackBerryContacts.addElement(cb);
add(checkBoxGroup);
}
public void fieldChanged(Field field, int context) {
boolean mProgrammatic = false;
if (!mProgrammatic) {
mProgrammatic = true;
cbField = (CheckboxField) field;
int index = blackBerryContacts.indexOf(cbField);
if (cbField.getChecked())
{
for(int i=0;i<blackBerryContacts.size();i++)
{
Dialog.inform("Selected::" + cbField.getLabel());
sbi=new StringBuffer();
sbi.append(cbField.getLabel());
}
}
mProgrammatic = false;
}
}}