Hello
I created renderer (MyRenderer) by blank container and set it to list
(MyList).
@Override
protected boolean initListModelMyList(List list) {
Vector vector = new Vector();
data = (Vector<Hashtable<String, String>>)
Storage.getInstance().readObject("data");
if (data == null) {
data = new Vector<Hashtable<String, String>>();
}
Container renderer = findMyRenderer(list);
for(int i = 0; i < data.getSize(); i++) {
Hashtable<String, String> ha = data.get(i);
//System.out.println(ha.get("name"));
renderer.setPropertyValue("name", ha.get("name"));
vector.add(dataList.getItemAt(i));
}
list.setModel(new com.codename1.ui.list.DefaultListModel(vector));
return true;
}
class dataList implements ListModel<Vector<Hashtable<String,
String>>>
{
@Override
public Vector<Hashtable<String, String>> getItemAt(int
index) {
if(data != null) {
Vector<Hashtable<String, String>> vector =
new Vector<Hashtable<String, String>>();
Hashtable<String, String> d =
data.get(index);
//System.out.println(d.get("name"));
vector.add(d);
return vector;
}
return null;
}
........
}
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/851d19ba-b51f-4034-9ed3-80b06ca64b70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.