Hi Shai,
I have tried to debug the EDT,everything looks to be normal, no exception was thrown. Can you elaborate on race conditions? I think it is because of some revalidate needed by the container of the list? maybe.
I also tried putting placeholder images, those show fine, but it does not refresh with the new images loaded from imagedownloadservice. here is the rest of the code in the render function.
Remember, it works correctly on simulator but not after built. This also works fine n correct on the first form, on the phone. I removed the scale of dimensions for now.
And have a container.revalidate() on the most outside container.
Any clues? Let me know if u need anymore info.
public Component getCellRendererComponent(Component list, Object model, Object value, int index, boolean isSelected) {
Hashtable v = (Hashtable) value;
String shopid = (String) v.get("Shopid");
String imagename = (String) v.get("Picture");
Image im = (Image)v.get("pic");
if(im == null && shopid != null && v.get("fetching") == null){
v.put("fetching", Boolean.TRUE);
try {
CoffeeShopAccess.getInstance().getPicture(shopid,String.valueOf(index),imagename,list, index, "pic", null, true);
} catch (Exception ex) {
ex.printStackTrace();
}
}else{
if(im!=null)
{
v.put("icon", im);
}
}
return super.getCellRendererComponent(list, model, value, index, isSelected);
}
Also, I was trying to accomplish this by ImageViewer, but in ImageViewer i cannot populate the images using ImageDownloadService as it only supports components with List type or Containter List type.
Any ways to work around it? I tried putting labels, calling Actioncallback but the ImageViewer although after adding images to its model, does not show downloaded images.
Anyways thats another issue, which was facing before i chose this way.